-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: GEOSGeom_createLinearRing_r returned a NULL pointer while opening in geopandas #1005
Comments
Hi @Meresmata, that typically means there is something wrong with the GEOS installation / or the version of GEOS that Shapely is finding. A workaround (but not really solving the underlying issue of course) is to disable the speedups: Can you show the output of |
Installing everything anew, didn't help. What seamed to work, was switching shapely form PyPI to https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely. |
I agree with @jorisvandenbossche. Nasty problems like this can happen if you have multiple incompatible installations of GEOS installed on the system. The only solution we have right now is to make sure you get all your packages from the same source, or build from source. |
I encounter the same problem today. Using the following codes suggested by @jorisvandenbossche solves the problem! Thank you~ import geopandas as gpd
import shapely
shapely.speedups.disable() My geopandas version is 0.9.0 and my shapely version is 1.7.1 |
Thanks a lot. It does work. But may I ask you why it can be useful, and what's the function of shapely.speedups? And after using disable(), what's the influence on the code, and what will happen using 'shapely.speedups.disable()'? Does the code run slower after using that? |
I am using Shapily in verion 1.7.1 and geopandas in version 0.8.1. Want to open a file in geopandas, a esri shape file in geopandas, but an error message from File "shapely\speedups_speedups.pyx", line 408, in shapely.speedups._speedups.geos_linearring_from_py
is returned:
ValueError: GEOSGeom_createLinearRing_r returned a NULL pointer
Expected behavior and actual behavior.
I was able to open the file before (infact today and did not update any package), only restarted the jupyter kernel. Because of some problems with my raster files (ram usage). The same error message is returned for code in jupyter and in script.
Operating system
OS: Windows 10
Environment: Virtualenv
Installation of shaply via pip (from PyPi)
Version:
Shapily 1.7.1
geopandas 0.8.1
Edit: when installalling the packages new with conda in an conda environment, everythink works just fine.
The text was updated successfully, but these errors were encountered: