Permalink
Browse files

fix WMS blank for classified raster with NaN, #5289

  • Loading branch information...
blazek committed Jun 27, 2016
1 parent 65bb7ec commit c3a5759dae997c8cfb370b7d1b7cdbb10b1d84de
Showing with 9 additions and 0 deletions.
  1. +9 −0 mapdrawgdal.c
View
@@ -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;
@@ -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;
@@ -1915,6 +1921,9 @@ msDrawRasterLayerGDAL_16BitClassification(
continue;
}
+ if( CPLIsNan(fRawValue) )
+ continue;
+
if(SKIP_MASK(j,i))
continue;

0 comments on commit c3a5759

Please sign in to comment.