[Geoserver-users] Raster nodata ruining display of GeoTiff

Hi list,
I have a geoTIFF generated in the usual way (inner types, overviews), but it’s grey-scale.

The gdalinfo:

Files: 2m_DSM__2012_2013.tif
Size is 28500, 42500
Coordinate System is:
PROJCS[“OSGB 1936 / British National Grid”,
GEOGCS[“OSGB 1936”,
DATUM[“OSGB_1936”,
SPHEROID[“Airy 1830”,6377563.396,299.3249646000044,
AUTHORITY[“EPSG”,“7001”]],
TOWGS84[446.448,-125.157,542.06,0.15,0.247,0.842,-20.489],
AUTHORITY[“EPSG”,“6277”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4277”]],
PROJECTION[“Transverse_Mercator”],
PARAMETER[“latitude_of_origin”,49],
PARAMETER[“central_meridian”,-2],
PARAMETER[“scale_factor”,0.9996012717],
PARAMETER[“false_easting”,400000],
PARAMETER[“false_northing”,-100000],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]],
AUTHORITY[“EPSG”,“27700”]]
Origin = (401000.000000000000000,312000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=DEFLATE
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 401000.000, 312000.000) ( 1d59’ 6.71"W, 52d42’19.17"N)
Lower Left ( 401000.000, 227000.000) ( 1d59’ 7.62"W, 51d56’27.85"N)
Upper Right ( 458000.000, 312000.000) ( 1d 8’29.60"W, 52d42’ 7.99"N)
Lower Right ( 458000.000, 227000.000) ( 1d 9’22.38"W, 51d56’16.97"N)
Center ( 429500.000, 269500.000) ( 1d34’ 1.66"W, 52d19’20.70"N)
Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
NoData Value=-9999
Overviews: 14250x21250, 7125x10625, 3563x5313, 1782x2657, 891x1329, 446x665

The problem is that when I load it into GeoServer, I see this in response to a standard WMS request:

http://wppgeog3/geoserver/Misc_Rasters/wms?LAYERS=Misc_Rasters%3A2m_DSM__2012_2013&STYLES=&FORMAT=image%2Fjpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A27700&BBOX=372556.640625,184500,486443.359375,354500&WIDTH=343&HEIGHT=512

Inline images 1

The black bit is “nodata” (-9999). The “InputTransparentColor” has been left empty. If I set it to a colour (any colour), I get an exception for my WMS response::

Error rendering coverage on the fast path
java.lang.IllegalStateException: Unsupported data type.


However, if I zoom in so that there is no nodata in the requested area, I get the correct response:

Inline images 2

This looks a lot like a bug, but just in case it’s not - is there anything specific I need to do with a greyscale GeoTIFF with nodata to get it to render properly?

Happens in 2.4.3 and the latest 2.5.x snapshot.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

Hi Jonathan,
when zooming in, you get the correct response due to the fact that the default style (raster) does a runtime enhancement based on the data values.

An approach to get them properly rendered is defining a SLD with a colorMap having a first transparent entry (set the opacity to 0) for all the values below a specific threashold.
As an instance, if all your good values are >= 0 you may define an entry to make transparent negative values.

Hope this helps.
Regards,

Daniele

image.png

image.png

···

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Wed, Apr 30, 2014 at 3:42 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi list,
I have a geoTIFF generated in the usual way (inner types, overviews), but it’s grey-scale.

The gdalinfo:

Files: 2m_DSM__2012_2013.tif
Size is 28500, 42500
Coordinate System is:
PROJCS[“OSGB 1936 / British National Grid”,
GEOGCS[“OSGB 1936”,
DATUM[“OSGB_1936”,
SPHEROID[“Airy 1830”,6377563.396,299.3249646000044,
AUTHORITY[“EPSG”,“7001”]],
TOWGS84[446.448,-125.157,542.06,0.15,0.247,0.842,-20.489],
AUTHORITY[“EPSG”,“6277”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4277”]],
PROJECTION[“Transverse_Mercator”],
PARAMETER[“latitude_of_origin”,49],
PARAMETER[“central_meridian”,-2],
PARAMETER[“scale_factor”,0.9996012717],
PARAMETER[“false_easting”,400000],
PARAMETER[“false_northing”,-100000],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]],
AUTHORITY[“EPSG”,“27700”]]
Origin = (401000.000000000000000,312000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=DEFLATE
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 401000.000, 312000.000) ( 1d59’ 6.71"W, 52d42’19.17"N)
Lower Left ( 401000.000, 227000.000) ( 1d59’ 7.62"W, 51d56’27.85"N)
Upper Right ( 458000.000, 312000.000) ( 1d 8’29.60"W, 52d42’ 7.99"N)
Lower Right ( 458000.000, 227000.000) ( 1d 9’22.38"W, 51d56’16.97"N)
Center ( 429500.000, 269500.000) ( 1d34’ 1.66"W, 52d19’20.70"N)
Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
NoData Value=-9999
Overviews: 14250x21250, 7125x10625, 3563x5313, 1782x2657, 891x1329, 446x665

The problem is that when I load it into GeoServer, I see this in response to a standard WMS request:

http://wppgeog3/geoserver/Misc_Rasters/wms?LAYERS=Misc_Rasters%3A2m_DSM__2012_2013&STYLES=&FORMAT=image%2Fjpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A27700&BBOX=372556.640625,184500,486443.359375,354500&WIDTH=343&HEIGHT=512

Inline images 1

The black bit is “nodata” (-9999). The “InputTransparentColor” has been left empty. If I set it to a colour (any colour), I get an exception for my WMS response::

Error rendering coverage on the fast path
java.lang.IllegalStateException: Unsupported data type.


However, if I zoom in so that there is no nodata in the requested area, I get the correct response:

Inline images 2

This looks a lot like a bug, but just in case it’s not - is there anything specific I need to do with a greyscale GeoTIFF with nodata to get it to render properly?

Happens in 2.4.3 and the latest 2.5.x snapshot.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users