[GRASS-SVN] r33716 - grass-addons/vector/v.what.rast.buffer
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 7 05:07:12 EDT 2008
Author: hamish
Date: 2008-10-07 05:07:12 -0400 (Tue, 07 Oct 2008)
New Revision: 33716
Modified:
grass-addons/vector/v.what.rast.buffer/v.what.rast.buffer
Log:
indent
Modified: grass-addons/vector/v.what.rast.buffer/v.what.rast.buffer
===================================================================
--- grass-addons/vector/v.what.rast.buffer/v.what.rast.buffer 2008-10-07 09:05:11 UTC (rev 33715)
+++ grass-addons/vector/v.what.rast.buffer/v.what.rast.buffer 2008-10-07 09:07:12 UTC (rev 33716)
@@ -172,30 +172,29 @@
val=`r.what in="$MAP" null=nan east_north="$EASTING,$NORTHING" | cut -f4 -d"|"`
# create subregion bounds centered on mark so we quickly process
-
-if [ 0 -eq 1 ] ; then
# only the local area.
- int_EASTING=`echo $EASTING | cut -f1 -d.`
- int_NORTHING=`echo $NORTHING | cut -f1 -d.`
-# change this to measure from center of cell the point lies in, or ...?
- # the following heavily relies on integer truncation.
- R_NORTH=`echo $(((($int_NORTHING / $RES) * $RES) + ((($BUFFER/$RES)+2) * $RES) ))`
- R_SOUTH=`echo $(((($int_NORTHING / $RES) * $RES) - ((($BUFFER/$RES)+2) * $RES) ))`
- R_EAST=`echo $(((($int_EASTING / $RES) * $RES) + ((($BUFFER/$RES)+2) * $RES) ))`
- R_WEST=`echo $(((($int_EASTING / $RES) * $RES) - ((($BUFFER/$RES)+2) * $RES) ))`
+ if [ 0 -eq 1 ] ; then
+ int_EASTING=`echo $EASTING | cut -f1 -d.`
+ int_NORTHING=`echo $NORTHING | cut -f1 -d.`
+ # change this to measure from center of cell the point lies in, or ...?
+ # the following heavily relies on integer truncation.
+ R_NORTH=`echo $(((($int_NORTHING / $RES) * $RES) + ((($BUFFER/$RES)+2) * $RES) ))`
+ R_SOUTH=`echo $(((($int_NORTHING / $RES) * $RES) - ((($BUFFER/$RES)+2) * $RES) ))`
+ R_EAST=`echo $(((($int_EASTING / $RES) * $RES) + ((($BUFFER/$RES)+2) * $RES) ))`
+ R_WEST=`echo $(((($int_EASTING / $RES) * $RES) - ((($BUFFER/$RES)+2) * $RES) ))`
- # zoom in on local region (for speed)
- g.region n=$R_NORTH s=$R_SOUTH e=$R_EAST w=$R_WEST res=$RES # -p
-else
- # alternate method: rely on g.region -a expansion
- R_NORTH=`echo $(($NORTHING + $BUFFER + $RES))`
- R_SOUTH=`echo $(($NORTHING - $BUFFER - $RES))`
- R_EAST=`echo $(($EASTING + $BUFFER + $RES))`
- R_WEST=`echo $(($EASTING - $BUFFER - $RES))`
+ # zoom in on local region (for speed)
+ g.region n=$R_NORTH s=$R_SOUTH e=$R_EAST w=$R_WEST res=$RES # -p
+ else
+ # alternate method: rely on g.region -a expansion
+ R_NORTH=`echo $(($NORTHING + $BUFFER + $RES))`
+ R_SOUTH=`echo $(($NORTHING - $BUFFER - $RES))`
+ R_EAST=`echo $(($EASTING + $BUFFER + $RES))`
+ R_WEST=`echo $(($EASTING - $BUFFER - $RES))`
- # zoom in on local region (for speed)
- g.region n=$R_NORTH s=$R_SOUTH e=$R_EAST w=$R_WEST res=$RES -a # -p
-fi
+ # zoom in on local region (for speed)
+ g.region n=$R_NORTH s=$R_SOUTH e=$R_EAST w=$R_WEST res=$RES -a # -p
+ fi
# get stats about surrounding area, ${100}m radius
g.message -v " Building Buffer ..."
More information about the grass-commit
mailing list