[GRASS-SVN] r65077 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 16 04:20:01 PDT 2015


Author: zarch
Date: 2015-04-16 04:20:00 -0700 (Thu, 16 Apr 2015)
New Revision: 65077

Modified:
   grass/trunk/lib/python/pygrass/vector/geometry.py
Log:
pygrass: Check returned value from Vect_point_on_line function

Modified: grass/trunk/lib/python/pygrass/vector/geometry.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/geometry.py	2015-04-16 09:59:59 UTC (rev 65076)
+++ grass/trunk/lib/python/pygrass/vector/geometry.py	2015-04-16 11:20:00 UTC (rev 65077)
@@ -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