Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from shapely.geometry import LineString
- line1 = LineString([(0,0), (2,2)])
- line2 = LineString([(0,2), (2,0)])
- print(line1.intersection(line2))
- POINT (1 1)
- import fiona
- from shapely.geometry import LineString
- sch = {}
- sch["properties"] = {}
- sch["geometry"] = "LineString"
- file = fiona.open("d:/tmp/test.gpkg", "w", driver="GPKG", schema=sch,)
- line1 = LineString([(0,0), (2,2)])
- line2 = LineString([(0,2), (2,0)])
- print(line1.intersection(line2))
- LINESTRING (2 2, 0 0)
- Traceback (most recent call last):
- File "test2.py", line 11, in <module>
- print(line1.intersection(line2))
- File "C:OSGEO4~1appsPython37libsite-packagesshapelygeometrybase.py", line 620, in intersection
- return geom_factory(self.impl['intersection'](self, other))
- File "C:OSGEO4~1appsPython37libsite-packagesshapelytopology.py", line 65, in __call__
- self._validate(other, stop_prepared=True)
- File "C:OSGEO4~1appsPython37libsite-packagesshapelytopology.py", line 19, in _validate
- if stop_prepared and not hasattr(ob, 'type'):
- File "C:OSGEO4~1appsPython37libsite-packagesshapelygeometrybase.py", line 352, in type
- return self.geometryType()
- File "C:OSGEO4~1appsPython37libsite-packagesshapelygeometrybase.py", line 348, in geometryType
- return geometry_type_name(self._geom)
- File "C:OSGEO4~1appsPython37libsite-packagesshapelygeometrybase.py", line 70, in geometry_type_name
- return GEOMETRY_TYPES[lgeos.GEOSGeomTypeId(g)]
- OSError: exception: access violation reading 0x0000000000000000
Add Comment
Please, Sign In to add comment