3

I was wondering how to avoid the Geoserver transformation that takes place once you request an image via GetMap by using image/geotiff at the end of the url sentence in the browser.

I am experimenting with a geotiff that has 300 x 300 pixels (290 KB) in the server.

If I set the parameters in the GetMap request (url):width=1012&height=1012 The output image will have 1012 x 1012 pixels (1,002 KB). If I request width=300&height=300 - as in the original - the output image will have 300 x 300 pixels and 290 KB.

If I overlap the two images, both have the same bounding rectangle but obviously the pixels don´t match, understood.

But the most intriguing and worrying thing is that if we analyze these 2 output images by using gdalinfo -stats in the command line, you will see that the 1012x1012 image has its parameters totally wrong (Minimum, Maximum, Mean, etc.) but the 300x300 one too.

In fact the original image is a Float32 raster and the 2 output ones are type Byte.

Is there any way of getting the original one from Geoserver, via url, without any transformation at all?

1
  • 1
    Use WCS service, it is made for such use.
    – user30184
    Commented Aug 9, 2014 at 9:14

1 Answer 1

2

When you make a WMS request you are asking for a picture of your data. The output is determined by the style you request (via the SLD you provide or the default). This is why the statistics are different for the the two files you request. Since the returned images are simply colours they can be stored in 3 bands of Byte - there is simply no need to use the Float values.

If you want to use the data values of the imagery then you need to make a WCS request which is like a WFS request (but for rasters) in that it returns the actual data not the picture of the map.

5
  • Following your advise, I have performed a WCS request with success..apparently because what Geoserver returns is an .eml file instead of a GeoTIFF file. How I deal with it? Commented Aug 10, 2014 at 11:46
  • I don't use WCS very often but I think you can specify the format that is returned
    – Ian Turton
    Commented Aug 10, 2014 at 14:04
  • Returning to the question above, do you know how geoserver calculates which Height and Width must be returned it via wms by Default? I don't see these in the GetCapabilities output. I mean when you click on Preview a layer in Geoserver, what tells what parameters (Width, Height) will go in the url by Default? Commented Aug 11, 2014 at 10:34
  • the client determines the size of the image to request
    – Ian Turton
    Commented Aug 11, 2014 at 11:03
  • 1
    EML file type is caused by the peculiar WCS 1.1.0 standard. Return results from WCS 1.1 GetCoverage requests are in multi-part mime format which typically means a first part as an xml document referencing the other parts of the message, one of those being the image. I suggest to use WCS 1.0.0 instead because it can send normal geotiffs.
    – user30184
    Commented Aug 11, 2014 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.