Skip to content

Commit

Permalink
netcdfdataset.cpp: Disregard valid range if min > max.
Browse files Browse the repository at this point in the history
This currently happens in GOES with the FDCF fire product (and other
products).  Rather than hide the data, drop the valid range and warn.
This does not fix the issue of the Power field's max valid being too
low.

The issues are known to the data provider.

https://www.ncdc.noaa.gov/data-access/satellite-data/goes-r-series-satellites#FDC

See OSGeo#1811
  • Loading branch information
schwehr committed Sep 3, 2019
1 parent ee5702e commit 7b52921
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gdal/frmts/netcdf/netcdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,16 @@ netCDFRasterBand::netCDFRasterBand( netCDFDataset *poNCDFDS,
}
}
}
if (bValidRangeValid && adfValidRange[0] > adfValidRange[1])
{
CPLError(
CE_Warning, CPLE_AppDefined,
"netCDFDataset::valid_range: min > max:\n"
" min: %lf\n max: %lf\n", adfValidRange[0], adfValidRange[1]);
bValidRangeValid = false;
adfValidRange[0] = 0.0;
adfValidRange[1] = 0.0;
}
}

// Special For Byte Bands: check for signed/unsigned byte.
Expand Down Expand Up @@ -11584,5 +11594,3 @@ bool NCDFIsUserDefinedType(int ncid, int type)
return false;
#endif
}


0 comments on commit 7b52921

Please sign in to comment.