Hi there… We managed to fix the problem so I wanted to respond to my own post in case anyone else has similar problems displaying zero values in a raster (geotiffs) in a multi layer germap request…
After reading the thread here relating to a similar bug – https://sourceforge.net/p/geoserver/mailman/message/34791663/ – we, installed the JAI-EXT extension.
At first, this altered/reversed the problem… Instead of zeros being interpreted as nodata, it seemed that nodata was now interpreted as zeros.
We then enabled the extension as described here – http://docs.geoserver.org/stable/en/user/webadmin/server/JAI.html .
This activated the JAI/JAIEXT Setup panel available from the left menu item on Geoserver.
Then experimenting with moving items over from the JAIEXT Operations to JAI Operations panels produced varying results in the output png image. The problem was finally resolved when “Scale” was the only item moved over to the JAI Operations panel. Then zeros and nodata values were being rendered as expected.
No idea why that works, but it does. Hope this info helps anyone with similar problem.
John
Subject: Problem rendering geotiff zero cell values in multilayer getmap request url
Hi there list,
I am stumped… I’ve constructed a GetMap request url (see sample url below) that includes multiple layers served from our GeoServer (running version 2.8.0 on an Amazon Web Server). The map includes a few basemap layers (shapefiles), and a raster (geotiff) layer. The geotiffs contain the following characteristics:
Data type: GDT_Float32 - Thirty two bit floating point
No Data Value: -3.40282e+38
Number of bands: 1
The result image (png) from this multilayer getmap request displays all layers as expected, however, all zero (“0”) values from the geotiff layer are missing… ?? The same problem occurs when substituting any of the various maptype geotiff layers that include zero as a legitimate value, whether it contains discrete classes (where raster contains 5 classes 0-4), or continuous range of values.
It is important to note that when I remove all of those additional basemap layers from the getmap request url, the resulting png image looks normal, with the zero values showing up as expected… The problem occurs ONLY when any additional layer is included in the url getmap request… I have tried several layer combinations and layer order with no success. Also note, when viewing the geotiff layer from GeoServer Layer Preview, it appears normal… Also, when exporting the geotiff from geoserver and displaying in Qgis, the layer looks fine and the zero values are included as expected… As a test, I have reclassed the grid to assign those zeros a nother number, and they show up… (but I need to retain the zeros;)
I first suspected this to be an issue with the SLD, but I have tried many different modifications to my SLD (colormap types = values, intervals etc) without any success. (See one of my current SLDs below). It seems that it is treating the zero values as nodata, and rendering them transparent, however if I set the sld to display the actual nodata values with an opacity =”1”, the zero value pixels are still not shown.
I have tried the same url pointing to the same layers, but on an older version of geoserver (insltalled on a different local server) and it works perfectly. Is it possible this is a bug with GeoServer 2.8.0? Or something else in the SLD?
Here is the SLD used for one particular geotiff layer that includes cell values 0-4:
<?xml version="1.0" encoding="ISO-8859-1"?>
cffdrs_fdr
Note, this is running through an Amazon Web Server (no public access)… Here is a sample url:
http://AWS-server-name-here.amazonaws.com/geoserver/public/wms?service=WMS%20&version=1.1.0%20&request=GetMap%20&layers=public:basemap_latlong,basemap_land,fdr20150808,basemap_na_lakes,basemap_inside_bndry%20&styles=%20&bbox=-2500000.0,-880000.0,3150000.0,3970000.0%20&width=880%20&height=760%20&srs=EPSG:42304%20&format=image%2Fpng%20
Thanks so much for any a help or suggestions!
John