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

JamesH james.holmes at newcastle.ac.uk
Tue Mar 27 08:31:07 PDT 2012


Apologies Pierre, the black areas around the original image (below) were the
nodata values from where it had been oreintated.
http://postgis.17.n6.nabble.com/file/n4661301/Site127.jpg 

SELECT ST_ValueCount(rast, 3, 0.0) FROM nclraster1 
returned 16742 and 16627 in bands 3 and 4 respectively.
and 
SELECT ST_ValueCount(ST_MapAlgebraExpr(a.rast, 4, b.rast, 3, 'rast1 +
rast2'), 1, 0.0) FROM nclraster1 a, nclraster1 b; 
returned 16223 pixels. 

Both bands 3 and 4 now have nodata values of 255.

How would you remove the nodatavalues from the calculation?

Kind Regards,
James

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



More information about the postgis-users mailing list