0

I gave created a GeoTIFF file with python/gdal as 16 bit floating point (to save space), using -999 as noData value.

In GeoServer (v2.15.2), I have defined an SLD color style for this layer. However, if a try to use this file in GeoServer, the layer gets labeled as unsigned 16bit and if I request the created layer through WMS, the colors are wrong. The GeoTIFF is added to GeoServer by creating a single GeoTIFF store+layer.

In order to see some detail in the retrieved WMS tiles, I created the following dunny SLD color table:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org   /1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" version="1.0.0">
<NamedLayer>
<Name>vcd</Name>
<UserStyle>
<Title>A raster style</Title>
<FeatureTypeStyle>
<Rule>
<RasterSymbolizer>
<Opacity>1.0</Opacity>
<ChannelSelection>
<GrayChannel>
<SourceChannelName>1</SourceChannelName>
</GrayChannel>
</ChannelSelection>
<ColorMap extended="false">
<ColorMapEntry color="#ffffff" quantity="0.5" />
<ColorMapEntry color="#00ff00" quantity="2." />
<ColorMapEntry color="#0000ff" quantity="1000." />
<ColorMapEntry color="#ff0000" quantity="50000." />
</ColorMap>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

The datacontent of the GeoTIFF is between -126 and +78 (see gdalinfo -mm data below), but in GeoTIFF it seems treated as the values are all far above 1000.

Sample tile

Is GeoServer simply not capable of serving this half-precision floating point type?

Here is the gdalinfo data for the GeoTIFF file.

Driver: GTiff/GeoTIFF
Files: 5p_tropomi_so2vcd_epsg3857_20200304_res0.01.tiff
Size is 36084, 36124
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
    AUTHORITY["EPSG","3857"]]
Origin = (-20026376.390000000596046,20048966.100000001490116)
Pixel Size = (1110.000000000000000,-1110.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=DEFLATE
INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-20026376.390,20048966.100) (179d54' 0.00"W, 85d 3'36.00"N)
Lower Left  (-20026376.390,-20048673.900) (179d54' 0.00"W, 85d 3'35.19"S)
Upper Right (20026863.610,20048966.100) (179d54'15.76"E, 85d 3'36.00"N)
Lower Right (20026863.610,-20048673.900) (179d54'15.76"E, 85d 3'35.19"S)
Center      (     243.610,     146.100) (  0d 0' 7.88"E,  0d 0' 4.72"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
Computed Min/Max=-126.500,78.625
NoData Value=-999
Overviews: 18042x18062, 9021x9031, 4511x4516, 2256x2258, 1128x1129, 564x565, 282x283
Image Structure Metadata:
    NBITS=16

I cannot immediately see something special in the GeoServer logs. When requesting the one tile:

https://myserver/geoserver/SACS/wms?&service=WMS&request=GetMap&layers=SACS%3As5p_tropomi_so2vcd_epsg3857_20200301_res0.01_test16bit&styles=test16bit&format=image%2Fpng&transparent=true&version=1.3.0&time=2020-03-01&width=256&height=256&srs=EPSG%3A3857&bbox=-20037508.342789244,-20037508.34278071,0,0

The logs says (default logging):

2020-03-10 15:49:19,911 INFO [geoserver.wms] - 
Request: getServiceInfo
2020-03-10 15:49:19,938 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GridEnvelope2D[0..304, 260..564], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 71016.3829787234], 
  PARAMETER["elt_0_2", -19990868.19851064], 
  PARAMETER["elt_1_1", -70969.27433628318], 
  PARAMETER["elt_1_2", 20013481.46283186]]]
2020-03-10 15:49:19,943 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GridEnvelope2D[0..304, 260..564], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 71016.3829787234], 
  PARAMETER["elt_0_2", -19990868.19851064], 
  PARAMETER["elt_1_1", -70969.27433628318], 
  PARAMETER["elt_1_2", 20013481.46283186]]]
2020-03-10 15:49:19,943 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GridEnvelope2D[542..563, 260..564], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 71016.3829787234], 
  PARAMETER["elt_0_2", -19990868.19851064], 
  PARAMETER["elt_1_1", -70969.27433628318], 
  PARAMETER["elt_1_2", 20013481.46283186]]]
2020-03-10 15:49:19,943 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GridEnvelope2D[542..563, 260..564], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 71016.3829787234], 
  PARAMETER["elt_0_2", -19990868.19851064], 
  PARAMETER["elt_1_1", -70969.27433628318], 
  PARAMETER["elt_1_2", 20013481.46283186]]]
2020-03-10 15:49:20,019 INFO [geoserver.wms] - 
Request: getMap
  Angle = 0.0
  BaseUrl = http://myserver/geoserver/
  Bbox = SRSEnvelope[-2.0037508342789244E7 : 0.0, -2.003750834278071E7 : 0.0]
  BgColor = java.awt.Color[r=255,g=255,b=255]
  Buffer = 0
  CQLFilter = null
  Crs = PROJCS["WGS 84 / Pseudo-Mercator", 
          GEOGCS["WGS 84", 
            DATUM["World Geodetic System 1984", 
            SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
            AUTHORITY["EPSG","6326"]], 
            PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
            UNIT["degree", 0.017453292519943295], 
            AXIS["Geodetic latitude", NORTH], 
            AXIS["Geodetic longitude", EAST], 
            AUTHORITY["EPSG","4326"]], 
          PROJECTION["Popular Visualisation Pseudo Mercator", AUTHORITY["EPSG","1024"]], 
          PARAMETER["semi_minor", 6378137.0], 
          PARAMETER["latitude_of_origin", 0.0], 
          PARAMETER["central_meridian", 0.0], 
          PARAMETER["scale_factor", 1.0], 
          PARAMETER["false_easting", 0.0], 
          PARAMETER["false_northing", 0.0], 
          UNIT["m", 1.0], 
          AXIS["Easting", EAST], 
          AXIS["Northing", NORTH], 
          AUTHORITY["EPSG","3857"]]
  Elevation = []
  Env = {}
  Exceptions = SE_XML
  FeatureId = null
  FeatureVersion = null
  Filter = null
  Filters = null
  Format = image/png
  FormatOptions = {}
  Get = true
  Height = 256
  Interpolations = []
  Layers = [org.geoserver.wms.MapLayerInfo@3c8b1770]
  MaxFeatures = null
  Palette = null
  RawKvp = {REQUEST=GetMap, FORMAT=image/png, SRS=EPSG:3857, BBOX=-20037508.342789244,-20037508.34278071,0,0, VERSION=1.3.0, STYLES=test16bit, SERVICE=WMS, TIME=2020-03-01, WIDTH=256, HEIGHT=256, TRANSPARENT=true, LAYERS=SACS:s5p_tropomi_so2vcd_epsg3857_20200301_res0.01_test16bit}
  RemoteOwsType = null
  RemoteOwsURL = null
  Request = GetMap
  RequestCharset = UTF-8
  ScaleMethod = null
  Sld = null
  SldBody = null
  SldVersion = null
  SortBy = null
  SortByArrays = null
  SRS = urn:ogc:def:crs:EPSG:3857
  StartIndex = null
  StyleBody = null
  StyleFormat = sld
  Styles = [StyleImpl[ name=test16bit]]
  StyleUrl = null
  StyleVersion = null
  Tiled = false
  TilesOrigin = null
  Time = [[Sun Mar 01 01:00:00 CET 2020, Mon Mar 02 00:59:59 CET 2020]]
  Transparent = true
  ValidateSchema = false
  Version = 1.3.0
  ViewParams = null
  Width = 256
  • Please use the edit link to add more information to your question, we need to know how you add the image to GeoServer, what the SLD looks like and what the log file says – Ian Turton Mar 10 at 13:54
0

After posting this question in the GeoServer user mailing list, I was informed that at this stage 32 bit floating point GeoTIFF files, with 16 bits used (the way I created the files) is not supported by GeoServer. I will create a ticket on this in the GeoServer JIRA.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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