[GRASS-SVN] r73478 - grass-addons/grass7/vector/v.gsflow.reaches

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 1 18:59:06 PDT 2018


Author: awickert
Date: 2018-10-01 18:59:06 -0700 (Mon, 01 Oct 2018)
New Revision: 73478

Modified:
   grass-addons/grass7/vector/v.gsflow.reaches/v.gsflow.reaches.py
Log:
v.gsflow.reaches: reach endpoint z high-res (DEM)


Modified: grass-addons/grass7/vector/v.gsflow.reaches/v.gsflow.reaches.py
===================================================================
--- grass-addons/grass7/vector/v.gsflow.reaches/v.gsflow.reaches.py	2018-10-02 00:47:14 UTC (rev 73477)
+++ grass-addons/grass7/vector/v.gsflow.reaches/v.gsflow.reaches.py	2018-10-02 01:59:06 UTC (rev 73478)
@@ -376,8 +376,12 @@
     # TOP AND BOTTOM ARE OUT OF ORDER: SOME SEGS ARE BACKWARDS. UGH!!!!
     # NEED TO GET THEM IN ORDER TO GET THE Z VALUES AT START AND END
 
+    # 2018.10.01: Updating this to use the computational region for the DEM
+    g.region(raster=elevation)
+    
     # Compute slope and starting elevations from the elevations at the start and 
     # end of the reaches and the length of each reach]
+    
     gscript.message('Obtaining elevation values from raster: may take time.')
     v.db_addcolumn(map=reaches, columns='zr1 double precision, zr2 double precision')
     zr1 = []
@@ -385,6 +389,7 @@
     for i in range(len(reach_cats)):
         _x = reach_x1s[i]
         _y = reach_y1s[i]
+        #print _x, _y
         _z = float(gscript.parse_command('r.what', map=elevation, coordinates=str(_x)+','+str(_y)).keys()[0].split('|')[-1])
         zr1.append(_z)
         _x = reach_x2s[i]



More information about the grass-commit mailing list