Opened 14 years ago

Last modified 7 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

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 (7)

comment:1 by jorgearevalo, 14 years ago

Status: newassigned

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

comment:2 by jorgearevalo, 14 years ago

Resolution: fixed
Status: assignedclosed

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

comment:3 by sbl, 11 years ago

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 by robe, 10 years ago

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.

in reply to:  4 comment:5 by sbl, 10 years ago

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 by Bborie Park, 10 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:7 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.