Opened 6 years ago

Last modified 2 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 Future
Component: raster Version: trunk
Keywords: loader, nan, gdal Cc: sbl

Description

PostGIS Raster loader must manage the situation when GDAL returns NaN for a band NODATA. Mathieu Basille detected the problem http://postgis.refractions.net/pipermail/postgis-users/2011-February/028850.html

Change History (6)

comment:1 Changed 6 years ago by jorgearevalo

Status: newassigned

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

comment:2 Changed 6 years ago by jorgearevalo

Resolution: fixed
Status: assignedclosed

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

comment:3 Changed 3 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 (http://osgeo-org.1560.x6.nabble.com/GRASS-created-geotiff-do-not-properly-load-into-PostGIS-raster2pgsql-tt5140697.html).

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: http://osgeo-org.1560.x6.nabble.com/gdal-dev-GDALSetRasterNoDataValue-and-NaN-td4996633.html

comment:4 Changed 3 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 3 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 2 years ago by dustymugs

Milestone: PostGIS 2.2.0PostGIS Future
Note: See TracTickets for help on using tickets.