[Fdo-trac] [fdo-trac] #723: Wrong No Data Value

FDO trac_fdo at osgeo.org
Thu Oct 15 01:42:47 PDT 2026


#723: Wrong No Data Value
----------------------------------------------+-------------------------
 Reporter:  sgamperl                          |        Owner:  gregboone
     Type:  defect                            |       Status:  closed
 Priority:  major                             |    Milestone:  3.6.0
Component:  WMS Provider                      |      Version:  3.4.0
 Severity:  1                                 |   Resolution:  fixed
 Keywords:  WMS, NullPixelValue, NODATAVALUE  |  External ID:
----------------------------------------------+-------------------------
Changes (by jng):

 * resolution:   => fixed
 * status:  new => closed

Comment:

 In [changeset:"8405" 8405]:
 {{{#!CommitTicketReference repository="" revision="8405"
 WMS Provider: only report a null pixel value when the image declares one

 Fixes #723.

 FdoWmsImage::_getNullPixelValue() substituted 0 whenever
 GDALGetRasterNoDataValue() reported that a band had no NODATA value, so
 IRaster::GetNullPixelValue() always handed back a non-null 0 for the
 ordinary
 WMS GetMap response: PNG and JPEG images do not carry a NODATA tag. 0 is a
 valid pixel value, and a valid palette index for palette data, so the
 fabricated value both hid the "no null pixel value" state (making the
 client
 side IsNull() test useless) and turned the first palette colour into "no
 data".

 A null pixel value is now only reported when GDAL reports one, and for
 RGB/RGBA
 the packed value is only produced when every component band declares one,
 so
 the WMS raster returns NULL as the GDAL provider
 (FdoRfpBandRaster::GetNullPixelValue()) already does in the same
 situation.

 Also fix the GPI_Gray branch of FdoWmsImage::_getDataModel(), which read
 colorEntry[i].c1 (out of bounds once i > 0) and left the green, blue and
 alpha
 channels of each palette entry uninitialised. Gray entries now populate
 all
 four channels, with an opaque alpha.

 Adds the offline WmsTestRaster suite: it builds its datasets with GDAL's
 MEM
 driver and drives FdoWmsRasterGdal directly, so it needs no WMS server.
 Its
 eight tests cover an absent NODATA value (gray, palette and rgb data
 models), a
 declared NODATA of 0, NODATA pass-through (Int16, palette index, all-band
 rgb)
 and gray palette population.

 Validation: WMSUnitTest WmsTestRaster on ubuntu22 amd64, Release OK (8)
 and
 Debug OK (8); before the fixes the same suite reported 3 failures (an
 absent
 NODATA reported as 0) and 1 failure (gray palette entries). A probe over
 real
 GetMap responses from two public WMS servers returned NullPixelValue 0 for
 PNG/JPEG before the change and NULL after it, while declared NODATA values
 are
 still returned.
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/fdo/ticket/723#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list