You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a polygon shapefile using Fiona and then converting that to a Shapely Polygon Shape returns the following error.
ValueError: GEOSGeom_createLinearRing_r returned a NULL pointer
`shp = fiona.open(r"shapefile.shp", 'r')
for pol in shp:
@wmobley thank you for the report. We need more information before we can begin to diagnose the situation. Can you copy here the value of pol['geometry'] which triggers the exception?
Ok, heres a csv with the polygon points. This was converted already in 1.6.4.post2, but you should be able to get what you need out of it. If not I can send the original shape file if that would work. test.zip
@wmobley I'm able to read and parse all the geometries with the following script.
import csv
from shapely.wkt import loads
with open("/Users/seang/Downloads/test.csv") as fobj:
reader = csv.reader(fobj)
header = next(reader)
for row in reader:
try:
g = loads(row[1])
print(g.wkt)
except:
import pdb; pdb.set_trace()
pass
If there's a problem, it's not in Shapely. I think that you may be experiencing some DLL incompatibility between Fiona and Shapely. We didn't have 1.6.4.post2 binary wheels for Windows on PyPI and don't have Fiona binary wheels for Windows on PyPI. You'll need to get Fiona and Shapely from the same package provider and then I think could can expect better results.
When loading a polygon shapefile using Fiona and then converting that to a Shapely Polygon Shape returns the following error.
ValueError: GEOSGeom_createLinearRing_r returned a NULL pointer
`shp = fiona.open(r"shapefile.shp", 'r')
for pol in shp:
I went back to version Version: 1.6.4.post2 and it fixed the error.
Operating system
Windows 10
Shapely version 1.7.0 from pip
Reverted to 1.6.4.post2 fixed the error.
The text was updated successfully, but these errors were encountered: