[postgis-users] POSTGIS2.0: wrong nodatavalue in ST_BandMetaData()
Tom van Tilburg
tom.van.tilburg at gmail.com
Thu Nov 17 04:14:29 PST 2011
Hi list,
Does anyone see the same happening as me with the ST_BandMetaData()?
See the following SQL:
----------------------------
UPDATE mytable
SET
rast = ST_SetBandNoDataValue(rast,1,0);
SELECT rid,
ST_Numbands(rast),
ST_BandNoDataValue(rast),
(foo.md).*
FROM (SELECT rid, rast, ST_BandMetaData(rast,1) As md
FROM mytable) As foo;
------------------------------
I am expecting two times the same result for the st_bandnodatavalue and
the metadata nodatavalue. In reality, the metadata nodatavalue gives me
values slightly diverting around zero.
Result:
1;1;-99;"32BSI";t;5.68386e-038;f;""
2;1;-99;"32BSI";t;5.68386e-038;f;""
3;1;-99;"32BSI";t;5.68386e-038;f;""
58;1;-99;"32BSI";t;2.92351e-036;f;""
137;1;-99;"32BSI";t;2.92351e-036;f;""
This is breaking GDAL output since the metadata needs to be identical
for every row when using mode = 2 in GDAL.
Example:
> gdalinfo -mm -stats -checksum "PG:host='localhost' dbname='raster'
user='postgres' password='mypass' table='mytable' mode='2'"
> ERROR 1: Error, the ONE_RASTER_PER_TABLE mode can't be applied if the
raster rows don't have the same metadata for band 1.
Thnx in advance,
Tom
More information about the postgis-users
mailing list