[GRASS-SVN] r43050 - grass-addons/LandDyn/r.catchment.py
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 11 16:12:33 EDT 2010
Author: isaacullah
Date: 2010-08-11 20:12:33 +0000 (Wed, 11 Aug 2010)
New Revision: 43050
Modified:
grass-addons/LandDyn/r.catchment.py/r.catchment.py
Log:
Update r.catchment to take out g.region commands that were causeing strange cell mismatches.
Modified: grass-addons/LandDyn/r.catchment.py/r.catchment.py
===================================================================
--- grass-addons/LandDyn/r.catchment.py/r.catchment.py 2010-08-11 20:12:13 UTC (rev 43049)
+++ grass-addons/LandDyn/r.catchment.py/r.catchment.py 2010-08-11 20:12:33 UTC (rev 43050)
@@ -16,7 +16,7 @@
#%Module
-#% description: Creates a raster buffer of specified area around vector points using cost distances. Requires r.walk.
+#% description: Creates a raster buffer of specified area around vector points using cost distances. Requires r.walk. NOTE: please run g.region first to make sure region boundaries and resoultion match input elevation map.
#%END
@@ -169,7 +169,7 @@
w_coefs = a + ',' + b + ',' + c + ',' + d
grass.message("Wanted buffer area=%s\n" % int(area))
- grass.run_command('g.region', quiet = True, rast = elev)
+
####################################################
if bool(os.getenv('GIS_OPT_incost')) is True:
grass.message('\n\nUsing input cost surface\n')
@@ -282,7 +282,10 @@
grass.run_command('g.remove', quiet = True, rast = 'cost.reclass')
if bool(os.getenv('GIS_OPT_sigma')) is True:
grass.run_command('g.remove', quiet = True, rast = slope)
- grass.run_command('g.remove', quiet = True, rast = 'MASK')
+ try:
+ grass.run_command('g.remove', quiet = True, rast = 'MASK')
+ except:
+ pass
grass.message(' DONE!')
return
More information about the grass-commit
mailing list