[GRASS-SVN] r70035 - grass-addons/grass7/raster/r.green/r.green.hydro/libhydro

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 7 13:39:02 PST 2016


Author: Giulia
Date: 2016-12-07 13:39:01 -0800 (Wed, 07 Dec 2016)
New Revision: 70035

Modified:
   grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/plant.py
Log:
r.green: fix bug length

Modified: grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/plant.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/plant.py	2016-12-07 20:58:48 UTC (rev 70034)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/plant.py	2016-12-07 21:39:01 UTC (rev 70035)
@@ -120,8 +120,8 @@
     dist = line.distance(point)
     l0 = line.segment(0, dist.sldist)
     l0.reverse()
-    max_l = min([max_dist, line.length()-dist.sldist])
-    l1 = line.segment(dist.sldist, dist.sldist+max_l)
+    lngth = min([max_dist+dist.sldist, line.length()])
+    l1 = line.segment(dist.sldist, lngth)
     return l0, l1
 
 
@@ -553,6 +553,8 @@
                        "Therefore %d will be used.")
                 print(msg % (contur_itk.id, contur_res.id, cnt.name,
                              contur_itk.id))
+                if contur_itk.id==5381:
+                    import ipdb; ipdb.set_trace()
 
             # check contour
             contur = not_overlaped(contur_itk)



More information about the grass-commit mailing list