On 25/05/12 13:12, Johannes Radinger wrote:
Hi,

I am trying to get statistical values for a raster map in a python script.
What I am doing so far is using r.univar (e.g. for the nc-dataset):

grass.read_command("r.univar", map ="elevation")

but how to get e.g the mean value as float?

There are probably more elegant ways, but this should work:

float(grass.read_command("r.univar", map="elevation").splitlines()[10].split()[4])

Moritz
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to