Opened 11 years ago

Closed 3 years ago

#376 closed defect (outdated)

GDAL returns incorrect NoData Value for PostGIS raster

Reported by: mlt Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords: gdal, postgis
Cc:

Description

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
  2. Import it like raster2pgsql -s 26915 -I -C -M dem.tif -t 50x50 public.dem50 | psql -d gis -U user
  3. Make sure the following returns 9999

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

  1. Test source file with gdalinfo

$ which gdalinfo /osgeo4w/bin/gdalinfo.exe

$ gdalinfo dem.tif | grep -i noda

NoData Value=9999

  1. And from PG

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

NoData Value=0

Here might (wasn't published as of submitting date) be a log.

Change History (2)

comment:1 by mlt, 11 years ago

OS is MS Windows XP 32 bit SP3
select version() returns "PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 32-bit"
select postgis_full_version() returns "POSTGIS="2.0.3 r11132" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER"

gdalinfo 1.10 from http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1500-gdal-1-10-0-mapserver-6-2-1.zip returns correct NoData Value=9999.

I suggest to update bundled GDAL if it does not break anything else.

comment:2 by jef, 3 years ago

Resolution: outdated
Status: newclosed
Note: See TracTickets for help on using tickets.