[GRASS-SVN] r71834 - grass-addons/grass7/vector/v.gsflow.grid

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 25 17:36:36 PST 2017


Author: awickert
Date: 2017-11-25 17:36:36 -0800 (Sat, 25 Nov 2017)
New Revision: 71834

Modified:
   grass-addons/grass7/vector/v.gsflow.grid/v.gsflow.grid.py
Log:
v.gsflow.grid downstream b.c. (mapcalc)

Modified: grass-addons/grass7/vector/v.gsflow.grid/v.gsflow.grid.py
===================================================================
--- grass-addons/grass7/vector/v.gsflow.grid/v.gsflow.grid.py	2017-11-26 01:15:50 UTC (rev 71833)
+++ grass-addons/grass7/vector/v.gsflow.grid/v.gsflow.grid.py	2017-11-26 01:36:36 UTC (rev 71834)
@@ -223,7 +223,7 @@
         # May not work with dx != dy!
         v.to_rast(input=pp, output='tmp', use='val', value=1, overwrite=True)
         r.buffer(input='tmp', output='tmp', distances=float(dx)*1.5, overwrite=True)
-        r.mapcalc('tmp2 = (tmp == 2) * '+raster_input, overwrite=True)
+        r.mapcalc('tmp2 = if(tmp==2,1,null()) * '+raster_input, overwrite=True)
         g.rename(raster=('tmp2','tmp'), overwrite=True, quiet=True)
         #r.mapcalc('tmp = if(isnull('+raster_input+',0,(tmp == 2)))', overwrite=True)
         #g.region(rast='tmp')
@@ -231,7 +231,7 @@
         r.drain(input=raster_input, start_points=pp, output='tmp2', overwrite=True)
         r.mapcalc('tmp3 = tmp2 * tmp', overwrite=True, quiet=True)
         g.rename(raster=('tmp3','tmp'), overwrite=True, quiet=True)
-        r.null(map='tmp', setnull=0)
+        #r.null(map='tmp', setnull=0) # Not necessary: center point removed above
         r.to_vect(input='tmp', output=bc_cell, type='point', column='z',
                   overwrite=gscript.overwrite(), quiet=True)
         v.db_addcolumn(map=bc_cell, columns=('row integer','col integer','x double precision','y double precision'), quiet=True)



More information about the grass-commit mailing list