Note: This document is for an older version of GRASS GIS that is outdated. You should upgrade, and read the current addon manual page.

If the new region bounds do not line up with a multiple of the map resolution the bounds will be extended outwards, preserving the region resolution.
If the -z flag is used, then in the case of a bounds/resolution incompatibility the resolution will be altered and the region bounds preserved. The -z flag requires that a value is given for the resolution option.
#!/bin/sh
# Spearfish dataset
# maps to use in query
VECT_MAP=archsites
RAST_MAP=elevation.10m
# set region from target raster
g.region rast="$RAST_MAP"
# clone current region
g.region save="tmp_region.$$"
# set temporary region storage
WIND_OVERRIDE="tmp_region.$$"
export WIND_OVERRIDE
# output column headings line
echo "cat|mean_elev|n"
# run the processing loop
v.out.ascii "$VECT_MAP" | ( while read LINE ; do
POINT=`echo $LINE | cut -f1,2 -d'|' | tr '|' ','`
CATEGORY=`echo $LINE | cut -f3 -d'|'`
g.region.point coord="$POINT" diam=150 res=10
r.circle -b coord="$POINT" max=100 out=MASK --quiet
eval `r.univar -g "$RAST_MAP"`
g.remove MASK --quiet
echo "$CATEGORY|$mean|$n"
done )
# remove the temporary region
unset WIND_OVERRIDE
g.remove region="tmp_region.$$" --quiet
Last changed: $Date: 2011-11-08 13:56:45 -0800 (Tue, 08 Nov 2011) $
Main index - general index - Full index
© 2003-2014 GRASS Development Team