I'm trying to script something with Python and GDAL/OGR and Shapely.
What I have:
- two LineString geometries: "geom1" and "geom2"
- I made an Intersection: "intersection = geom1.Intersection(geom2)"
Now I wanted to check, if the intersection-Point is either the starting- or endingpoint (or none of both) of one of the input geometries.
What I did:
from shapely.geometry import Point point_start_1 = Point(geom1.GetPoint_2D(0)) point_end_1 = Point(geom1.GetPoint_2D(geom1.GetPointCount()-1)) point_start_2 = Point(geom2.GetPoint_2D(0)) point_end_2 = Point(geom2.GetPoint_2D(geom2.GetPointCount()-1))
The following code won't work:
if intersection.Intersects(point_start_1): print "intersection and Starting Point of geom1 is the same Point"
The Error Message is:
"TypeError: in method 'Geometry_Intersects', argument 2 of type 'OGRGeometryShadow *'"
My Question is:
What is a OGRGeometryShadow and why can't I intersect it with another Geometry? When I print the start_point_1 it says: "POINT (6.331836999999999 53.6154012)" So it looks like a normal geometry. But as I said "Intersects"-method doesn't work.