[Geoserver-users] WCS request parameters

Hi,

I'm using a WCS request to download a portion of a coverage stored in
geoserver.

There are two WCS options that can be used to define the returned image
size.

WIDTH / HEIGHT
or
RESX / RESY

As an example (given a constant BBOX), If I use WIDTH = 150 pixels and
HEIGHT=250 pixels (corresponding to X and Y resolutions of 100 m/pixel), the
dimensions of the returned image are correct.

However, if I specify RESX=100 and RESY=100, the returned image has
dimensions: w=250, h=150 (i.e. opposite to the previous).

Both images cover the correct BBOX region but the second image is sampled
incorrectly.

Is the a WCS bug in geoserver or is my understanding of the parameters
incorrect?

Any help appreciated,
Dave

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21353711.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Which CRS are you requesting? The meaning of resX and resY parameters
depend on the Coordinate Reference System in which the BBOX is
expressed.

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Thu, Jan 8, 2009 at 4:12 PM, djud <djud@anonymised.com> wrote:

Hi,

I'm using a WCS request to download a portion of a coverage stored in
geoserver.

There are two WCS options that can be used to define the returned image
size.

WIDTH / HEIGHT
or
RESX / RESY

As an example (given a constant BBOX), If I use WIDTH = 150 pixels and
HEIGHT=250 pixels (corresponding to X and Y resolutions of 100 m/pixel), the
dimensions of the returned image are correct.

However, if I specify RESX=100 and RESY=100, the returned image has
dimensions: w=250, h=150 (i.e. opposite to the previous).

Both images cover the correct BBOX region but the second image is sampled
incorrectly.

Is the a WCS bug in geoserver or is my understanding of the parameters
incorrect?

Any help appreciated,
Dave

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21353711.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

It's CRS EPSG:3031. Antarctic Polar Stereographic.

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21354845.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Is it expressed in meters?

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Thu, Jan 8, 2009 at 5:12 PM, djud <djud@anonymised.com> wrote:

It's CRS EPSG:3031. Antarctic Polar Stereographic.

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21354845.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Yes, in metres.

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21355266.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Mmm, quite strange then ... can you send the whole GetCoverage
requests in both cases?

The meaning of the resX and resY params should be resY = BBOX.w /
width and resX = BBOX.h / height

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Thu, Jan 8, 2009 at 5:31 PM, djud <djud@anonymised.com> wrote:

Yes, in metres.

--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21355266.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I execute the HTTP request using a hidden form. The two cases (downloadWH and
downloadXY) are as follows:

<form name="downloadWH" action="http://localhost/geoserver/wcs&quot;&gt;
   <input type="hidden" name="service" value="WCS">
   <input type="hidden" name="version" value="1.0.0">
   <input type="hidden" name="request" value="GetCoverage">
   <input type="hidden" name="coverage" value="GST:int_pol.edt">
   <input type="hidden" name="crs" value="EPSG:3031">
   <input type="hidden" name="bbox"
value="-6470158.7,114770,-4547761.2,1233777.5">
   <input type="hidden" name="width" value="246">
   <input type="hidden" name="height" value="424">
   <input type="hidden" name="format" value="GeoTIFF">
</form>

<form name="downloadXY" action="http://localhost/geoserver/wcs&quot;&gt;
   <input type="hidden" name="service" value="WCS">
   <input type="hidden" name="version" value="1.0.0">
   <input type="hidden" name="request" value="GetCoverage">
   <input type="hidden" name="coverage" value="GST:int_pol.edt">
   <input type="hidden" name="crs" value="EPSG:3031">
   <input type="hidden" name="bbox"
value="-6470158.7,114770,-4547761.2,1233777.5">
   <input type="hidden" name="resx" value="4531.13905">
   <input type="hidden" name="resy" value="4531.13905">
   <input type="hidden" name="format" value="GeoTIFF">
</form>

Thanks for the help,
Dave
--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21355960.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hello,

actually I don't understand exactly what you would like to do but
taking a look at your forms I get a bit different values for RESX and
RESY in order to have the same final resolution, in particular they
should be

RESX = (6470158,7 - 4547761,2) / 424 = 4533,9563679245283018867924528302

RESY = (1233777,5 - 114770) / 246 = 4548,8109756097560975609756097561

is it right? Can you also send if possible the output images obtined?

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Thu, Jan 8, 2009 at 6:02 PM, djud <djud@anonymised.com> wrote:

I execute the HTTP request using a hidden form. The two cases (downloadWH and
downloadXY) are as follows:

<form name="downloadWH" action="http://localhost/geoserver/wcs&quot;&gt;
  <input type="hidden" name="service" value="WCS">
  <input type="hidden" name="version" value="1.0.0">
  <input type="hidden" name="request" value="GetCoverage">
  <input type="hidden" name="coverage" value="GST:int_pol.edt">
  <input type="hidden" name="crs" value="EPSG:3031">
  <input type="hidden" name="bbox"
value="-6470158.7,114770,-4547761.2,1233777.5">
  <input type="hidden" name="width" value="246">
  <input type="hidden" name="height" value="424">
  <input type="hidden" name="format" value="GeoTIFF">
</form>

<form name="downloadXY" action="http://localhost/geoserver/wcs&quot;&gt;
  <input type="hidden" name="service" value="WCS">
  <input type="hidden" name="version" value="1.0.0">
  <input type="hidden" name="request" value="GetCoverage">
  <input type="hidden" name="coverage" value="GST:int_pol.edt">
  <input type="hidden" name="crs" value="EPSG:3031">
  <input type="hidden" name="bbox"
value="-6470158.7,114770,-4547761.2,1233777.5">
  <input type="hidden" name="resx" value="4531.13905">
  <input type="hidden" name="resy" value="4531.13905">
  <input type="hidden" name="format" value="GeoTIFF">
</form>

Thanks for the help,
Dave
--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21355960.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I've attached the two WCS files and a dump of the tiff headers.

Yeah, ideally I'd like a resolution of 4531.13905 but, because the width and
height have to be whole integers, you can't get the exact resolution you
want; so 4548.8 and 4533.9 are acceptable.

If you look at the tiff headers though, I don't even get 4548.8 and 4533.9.
Because of the raster type (PixelIsPoint) and probably because it's a tiled
tiff, the WCS returns resolutions of 4676.1 and 4660.8. This again is
acceptable.

The problem is that if I specify the resolutions instead of the width and
height the WCS should return an image that's close to 246x424 but it doesn't
- it returns an image of 424x246 (w=h, h=w) and the resolutions are
consequently really wrong (2713.0 and 8033.3).

Looks like some values are being switched in the code - X has become Y and Y
has become X.

Hope that helps, cheers,
Dave

http://www.nabble.com/file/p21369210/int_pol.edt.wh.tif int_pol.edt.wh.tif
http://www.nabble.com/file/p21369210/int_pol.edt.xy.tif int_pol.edt.xy.tif
http://www.nabble.com/file/p21369210/int_pol.edt.wh.tif.dump
int_pol.edt.wh.tif.dump
http://www.nabble.com/file/p21369210/int_pol.edt.xy.tif.dump
int_pol.edt.xy.tif.dump
--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21369210.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Ah ok, I see ... we will inspect the code if some error are present in
the wh computation given the xy resolutions.

Many thanks, I'll let you know as soon as possible.

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Fri, Jan 9, 2009 at 10:50 AM, djud <djud@anonymised.com> wrote:

I've attached the two WCS files and a dump of the tiff headers.

Yeah, ideally I'd like a resolution of 4531.13905 but, because the width and
height have to be whole integers, you can't get the exact resolution you
want; so 4548.8 and 4533.9 are acceptable.

If you look at the tiff headers though, I don't even get 4548.8 and 4533.9.
Because of the raster type (PixelIsPoint) and probably because it's a tiled
tiff, the WCS returns resolutions of 4676.1 and 4660.8. This again is
acceptable.

The problem is that if I specify the resolutions instead of the width and
height the WCS should return an image that's close to 246x424 but it doesn't
- it returns an image of 424x246 (w=h, h=w) and the resolutions are
consequently really wrong (2713.0 and 8033.3).

Looks like some values are being switched in the code - X has become Y and Y
has become X.

Hope that helps, cheers,
Dave

http://www.nabble.com/file/p21369210/int_pol.edt.wh.tif int_pol.edt.wh.tif
http://www.nabble.com/file/p21369210/int_pol.edt.xy.tif int_pol.edt.xy.tif
http://www.nabble.com/file/p21369210/int_pol.edt.wh.tif.dump
int_pol.edt.wh.tif.dump
http://www.nabble.com/file/p21369210/int_pol.edt.xy.tif.dump
int_pol.edt.xy.tif.dump
--
View this message in context: http://www.nabble.com/WCS-request-parameters-tp21353711p21369210.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users