Quellcode durchsuchen

pygrass: backport 65077, Check returned value from Vect_point_on_line function

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@65368 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli vor 10 Jahren
Ursprung
Commit
fad57dd3bd
1 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen
  1. 6 5
      lib/python/pygrass/vector/geometry.py

+ 6 - 5
lib/python/pygrass/vector/geometry.py

@@ -630,11 +630,12 @@ class Line(Geo):
             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