Nine columns are generated (n, min, max, range, mean, stddev, variance, coeff_var, sum) according to the output of r.univar.zonal. Column n complies column non_null_cells from r.univar.zonal and all univariate statistics are based on non_null_cells. If the -e extended statistics flag is given the 1st quartile, median, 3rd quartile, and given percentile are also calculated.
The script stops if a (prefixed) upload column is already present in the vector map attribute table, unless otherwise instructed with the -c continue flag. The column prefix will be separated from the statistic name with an underscore. For example with a prefix of "elev" the sum column will be named elev_sum.
If a DBF database is being used, note that column names are restricted by the DBF specification to 10 characters. Therefore it is advised to be economical in the use of the column prefix when using DBF as any additional characters will be chopped off.
If a MASK is present, it will be restored after the script finished. The script changes temporarily to the resolution of the given raster map.
At the moment not all univariate statistics calculated by r.univar.zonal are added to the vector attribute table. It is currently limited to the values used in the GRASS module v.rast.stats.
# work on copy of original map: g.copy vect=fields,myfields # if needed, zoom to raster map: g.region rast=elevation.dem -p # calculate DEM statistics, upload to vector map table: v.rast.stats2 myfields raster=elevation.dem colprefix=dem # verify results: v.info -c myfields v.db.select myfields v.univar myfields column=dem_range type=centroid
Last changed: $Date$
Main index - vector index - Full index
© 2003-2016 GRASS Development Team