Opened 9 years ago

Last modified 3 years ago

#828 reopened defect

[raster] Loader generates wrong SQL when NODATA for a band is NaN

Reported by: jorgearevalo Owned by: jorgearevalo
Priority: medium Milestone: PostGIS Fund Me
Component: raster Version: master
Keywords: loader, nan, gdal Cc: sbl


PostGIS Raster loader must manage the situation when GDAL returns NaN for a band NODATA. Mathieu Basille detected the problem

Change History (7)

comment:1 Changed 9 years ago by jorgearevalo

Status: newassigned

I think is solved in r6815. Waiting for confirmation (works for me)

comment:2 Changed 9 years ago by jorgearevalo

Resolution: fixed
Status: assignedclosed

I resolve the ticket as fixed. Seems to work fine.

comment:3 Changed 6 years ago by sbl

Cc: sbl added
Milestone: PostGIS 2.0.0PostGIS 2.1.4
Resolution: fixed
Status: closedreopened

Reopening,since the problem seems to reoccure (

Looks like the NaN check in the Python version did not make it to the C-version... Maybe raster2pgsql needs to call CPLIsNan from GDAL explicitly: See:

comment:4 Changed 6 years ago by robe

Milestone: PostGIS 2.1.4PostGIS 2.2.0

I think strk and dustymugs were planning to do some major rework in 2.2 on raster2pgsql so might be safer to just deal with it then rather than having two drastically different versions.

comment:5 in reply to:  4 Changed 6 years ago by sbl

For those affected by this bug: a work around is to create a temporary vrt-file where you define a suitable NoData? value, like this:

gdal_translate -of VRT -a_nodata 99999 your_raster.tif your_raster.vrt

The vrt can then be imported to PostGIS using the raster loader...

comment:6 Changed 5 years ago by Bborie Park

Milestone: PostGIS 2.2.0PostGIS Future

comment:7 Changed 3 years ago by robe

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.