Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#7097 closed defect (fixed)

Non-finite nodata values are getting clamped

Reported by: cdestigter Owned by: warmerdam
Priority: normal Milestone: 2.2.3
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

In [31514] clamping was added for invalid nodata values.

Unfortunately it didn't check if the values were finite, so non-finite values are getting clamped too.

However, -inf/inf/nan are actually very _good_ values for nodata:

  • they aren't likely to otherwise appear in the band data
  • they're specific, known values that can't be mathsed, rounded or otherwise munged.

We've been using them without problems for several years for nodata in our float-band gridded rasters.

This commit fixes the problem: https://github.com/koordinates/gdal/commit/1d465f64c327a95056c482c14c19744af07ae94c

Change History (3)

comment:1 Changed 2 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40478:

Fix issue with GDALAdjustValueToDataType(Float32, +/- inf) that didn't preserve infinity, which affected gdalwarp -dstnodata inf (derived from patch by Craig de Stigter, fixes #7097)

comment:2 Changed 2 months ago by Even Rouault

In 40479:

Fix issue with GDALAdjustValueToDataType(Float32, +/- inf) that didn't preserve infinity, which affected gdalwarp -dstnodata inf (derived from patch by Craig de Stigter, fixes #7097)

comment:3 Changed 2 months ago by Even Rouault

Milestone: 2.2.3
Note: See TracTickets for help on using tickets.