[postgis-users] NDVI Calculation from two bands within one Raster

JamesH james.holmes at newcastle.ac.uk
Wed Apr 11 10:44:03 PDT 2012

"Are you using ST_dumpAsPolygons() to display in OpenJump? Try looking at
individual pixel values with ST_Value() or us ST_PixelAsPolygons()"

I was using DumpAsPolygons. Used ST_PixelAsPolygons and this returned the
same, either zero, one or NullData.

If it helps my GDAL version is: GDAL="GDAL 1.9.0, released 2011/12/29" 

"Try looking at individual pixel values with ST_Value()"
Examined and in the final output, St_ValueCount returns:
(0, 32980)
(1, 519)

Looked closer at the calculation with ST_ValueCount and
[rast1] - [rast2] = (0, 17458)
[rast1]+[rast2] = (0, 16223)
so at some point these must be dividing by zero? Could this be affecting the

Kind Regards,

GIS Undergraduate
View this message in context: http://postgis.17.n6.nabble.com/NDVI-Calculation-from-two-bands-within-one-Raster-tp4656995p4832963.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

More information about the postgis-users mailing list