[GRASS-SVN] r65368 - grass/branches/releasebranch_7_0/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 4 22:08:46 PDT 2015


Author: zarch
Date: 2015-06-04 22:08:46 -0700 (Thu, 04 Jun 2015)
New Revision: 65368

Modified:
   grass/branches/releasebranch_7_0/lib/python/pygrass/vector/geometry.py
Log:
pygrass: backport 65077, Check returned value from Vect_point_on_line function

Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/vector/geometry.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/vector/geometry.py	2015-06-05 05:07:03 UTC (rev 65367)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/vector/geometry.py	2015-06-05 05:08:46 UTC (rev 65368)
@@ -630,11 +630,12 @@
             str_err = "The distance exceed the lenght of the line, that is: %f"
             raise ValueError(str_err % maxdist)
         pnt = Point(0, 0, -9999)
-        libvect.Vect_point_on_line(self.c_points, distance,
-                                   pnt.c_points.contents.x,
-                                   pnt.c_points.contents.y,
-                                   pnt.c_points.contents.z,
-                                   angle, slope)
+        if not libvect.Vect_point_on_line(self.c_points, distance,
+                                          pnt.c_points.contents.x,
+                                          pnt.c_points.contents.y,
+                                          pnt.c_points.contents.z,
+                                          angle, slope):
+            raise ValueError("Vect_point_on_line give an error.")
         pnt.is2D = self.is2D
         return pnt
 



More information about the grass-commit mailing list