Skip to content

Commit

Permalink
Merge pull request #5297 from blazek/wms-nan-fix
Browse files Browse the repository at this point in the history
Fix WMS blank for classified raster with NaN,
  • Loading branch information
rouault committed Jun 27, 2016
2 parents 65bb7ec + c3a5759 commit 16d841f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mapdrawgdal.c
Expand Up @@ -1270,6 +1270,9 @@ LoadGDALImages( GDALDatasetH hDS, int band_numbers[4], int band_count,
if( bGotNoData && pafRawData[i] == fNoDataValue )
continue;

if( CPLIsNan(pafRawData[i]) )
continue;

if( !bMinMaxSet ) {
dfScaleMin = dfScaleMax = pafRawData[i];
bMinMaxSet = TRUE;
Expand Down Expand Up @@ -1764,6 +1767,9 @@ msDrawRasterLayerGDAL_16BitClassification(
if( bGotNoData && pafRawData[i] == fNoDataValue )
continue;

if( CPLIsNan(pafRawData[i]) )
continue;

if( !bGotFirstValue ) {
fDataMin = fDataMax = pafRawData[i];
bGotFirstValue = TRUE;
Expand Down Expand Up @@ -1915,6 +1921,9 @@ msDrawRasterLayerGDAL_16BitClassification(
continue;
}

if( CPLIsNan(fRawValue) )
continue;

if(SKIP_MASK(j,i))
continue;

Expand Down

0 comments on commit 16d841f

Please sign in to comment.