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

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Apr 11 10:48:06 PDT 2012


Add a pixeltype parameter to your ST_MapAlgebraExpr call.

Pierre

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of JamesH
> Sent: Wednesday, April 11, 2012 1:44 PM
> To: postgis-users at postgis.refractions.net
> Subject: Re: [postgis-users] NDVI Calculation from two bands within one Raster
> 
> "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
> NDVI?
> 
> Kind Regards,
> James
> 
> -----
> 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.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list