[GRASS-SVN] r66026 - in grass-addons/grass7/raster/r.green/r.green.hydro: r.green.hydro.optimal r.green.hydro.recommended

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 26 00:53:19 PDT 2015


Author: Giulia
Date: 2015-08-26 00:53:19 -0700 (Wed, 26 Aug 2015)
New Revision: 66026

Modified:
   grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
   grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py
Log:
r.green: bugs in the cleanup

Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py	2015-08-26 07:52:13 UTC (rev 66025)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py	2015-08-26 07:53:19 UTC (rev 66026)
@@ -134,7 +134,7 @@
 
 def main(options, flags):
     TMPRAST, TMPVECT, DEBUG = [], [], False
-    atexit.register(cleanup, rast=TMPRAST, vect=TMPVECT, debug=DEBUG)
+    atexit.register(cleanup, raster=TMPRAST, vector=TMPVECT, debug=DEBUG)
     elevation = options['elevation']
     river = options['river']  # raster
     discharge = options['discharge']  # vec
@@ -172,11 +172,10 @@
     range_plant = (len_min, len_plant)
     plants = find_segments(river, discharge, elevation, range_plant, distance,
                            p_max)
-                           
-    if output_plant:
-        write_plants(plants, output_plant, efficiency, p_min)
-    write_points(plants, output_point, efficiency, p_min)
 
+    if output_point:
+        write_points(plants, output_point, efficiency, p_min)
+    write_plants(plants, output_plant, efficiency, p_min)
 
 if __name__ == "__main__":
     options, flags = gcore.parser()

Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py	2015-08-26 07:52:13 UTC (rev 66025)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.recommended/r.green.hydro.recommended.py	2015-08-26 07:53:19 UTC (rev 66026)
@@ -166,11 +166,6 @@
 #% required: yes
 #%end
 #%option G_OPT_V_OUTPUT
-#% key: output_point
-#% description: Name of output vector with potential intakes and restitution
-#% required: no
-#%end
-#%option G_OPT_V_OUTPUT
 #% key: output_vis
 #% description: Name of output vector with viewed areas
 #% required: no
@@ -229,7 +224,7 @@
 
 def main(opts, flgs):
     TMPRAST, TMPVECT, DEBUG = [], [], flgs['d']
-    atexit.register(cleanup, rast=TMPRAST, vect=TMPVECT, debug=DEBUG)
+    atexit.register(cleanup, raster=TMPRAST, vector=TMPVECT, debug=DEBUG)
     OVW = gcore.overwrite()
 
     dtm = options['elevation']
@@ -241,7 +236,6 @@
     len_min = options['len_min']
     distance = options['distance']
     output_plant = options['output_plant']
-    output_point = options['output_point']
     area = options['area']
     buff = options['buff']
     efficiency = options['efficiency']
@@ -264,11 +258,12 @@
 
     if area:
         if buff:
+            area_tmp = 'tmp_buff_area_%05d' % pid
             gcore.run_command('v.buffer',
                               input=area,
-                              output='buff_area',
+                              output=area_tmp,
                               distance=buff, overwrite=OVW)
-            area = 'tmp_buff_area_%05d' % pid
+            area = area_tmp
             TMPVECT.append(area)
 
         oriver = 'tmp_river_%05d' % pid
@@ -347,7 +342,6 @@
                       elevation=dtm,
                       len_plant=len_plant,
                       output_plant=output_plant,
-                      output_point=output_point,
                       distance=distance,
                       len_min=len_min,
                       efficiency=efficiency,



More information about the grass-commit mailing list