[osgeo4w-dev] [osgeo4w] #376: GDAL returns incorrect NoData Value for PostGIS raster

OSGeo4W trac_osgeo4w at osgeo.org
Fri Sep 20 14:10:08 PDT 2013

#376: GDAL returns incorrect NoData Value for PostGIS raster
Reporter:  mlt     |       Owner:  osgeo4w-dev@…              
    Type:  defect  |      Status:  new                        
Priority:  major   |   Component:  Package                    
 Version:          |    Keywords:  gdal,postgis               
 I don't have newer binary and did not do thorough testing but here is what
 I suspect will demonstrate the issue with OSGeo4W as of 2013-09-20.

 Steps to reproduce:

 1. Create some GeoTIFF raster with 9999 as NoData[[BR]]
 2. Import it like raster2pgsql -s 26915 -I -C -M dem.tif -t 50x50
 public.dem50 | psql -d gis -U user[[BR]]
 3. Make sure the following returns 9999[[BR]]

 SELECT ST_BandNoDataValue(rast,1) As bnval1
 FROM dem50
 WHERE rid = 1;

 4. Test source file with gdalinfo

 $ which gdalinfo

 $ gdalinfo dem.tif | grep -i noda
   NoData Value=9999

 5. And from PG

 $ gdalinfo 'PG:dbname=gis table=dem50 mode=2' | grep -i noda
   NoData Value=0

 [http://irclogs.geoapt.com/postgis/%23postgis.2013-09-20.log Here] might
 (wasn't published as of submitting date) be a log.

Ticket URL: <http://trac.osgeo.org/osgeo4w/ticket/376>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.

More information about the osgeo4w-dev mailing list