-
Notifications
You must be signed in to change notification settings - Fork 215
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
Segmentation fault: pyproj chrashes python when changing crs #351
Comments
What version of geopandas are you using? |
Also, can you share the dataset that you used in this example? |
I attempted to reproduce it on my linux machine to no avail: >>> import geopandas
>>> geopandas.__version__
'0.5.0'
>>> import pyproj
>>> pyproj.__version__
'2.2.0'
>>> from shapely.geometry import Point
>>> gsr = geopandas.GeoSeries([Point(-87.93514385942143, 42.0008891160732) for _ in range(1000)])
>>> gsr.crs = {'init': 'epsg:4326'}
>>> gsp = gsr.to_crs({'init':'epsg:3435'})
>>> gsp.head()
0 POINT (1092481.559999997 1943165.633693904)
1 POINT (1092481.559999997 1943165.633693904)
2 POINT (1092481.559999997 1943165.633693904)
3 POINT (1092481.559999997 1943165.633693904)
4 POINT (1092481.559999997 1943165.633693904)
dtype: object I wonder if providing the dataset will produce more insight? If not, it could be a MacOS specific issue. |
@snowman2 the dataset in this example is the city boundary of Chicago, downloaded from the Chicago Data Portal. I tried to reproduce your example but I got again a segmentation fault. Here's the code which also shows the versions of geopandas and pyproj I'm using:
|
@snowman2, also, I retried it with pyproj version 2.1.3 and I get no errors. |
@juanfrans. thanks for getting back. The information you provided is very useful. Next debugging steps would be, would you mind running with pyproj 2.2.0 and letting us know how it goes: >>> from pyproj import CRS, Transformer
>>> crs_4326 = CRS({'init': 'epsg:4326'})
>>> crs_4326
<Geographic 2D CRS: +init=epsg:4326 +type=crs>
Name: WGS 84
Axis Info [ellipsoidal]:
- lon[east]: Longitude (degree)
- lat[north]: Latitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
>>> crs_3435 = CRS({'init':'epsg:3435'})
>>> crs_3435
<Projected CRS: EPSG:3435>
Name: NAD83 / Illinois East (ftUS)
Axis Info [cartesian]:
- E[east]: Easting (US survey foot)
- N[north]: Northing (US survey foot)
Area of Use:
- name: USA - Illinois - SPCS - E
- bounds: (-89.28, 37.06, -87.02, 42.5)
Coordinate Operation:
- name: SPCS83 Illinois East zone (US Survey feet)
- method: Transverse Mercator
Datum: North American Datum 1983
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
>>> transformer = Transformer.from_crs(crs_4326, crs_3435)
>>> transformer.transform(-87.93514385942143, 42.000889116)
(1092481.5600001211, 1943165.6336672339) |
Also, please try this too:
|
@snowman2, I re-installed pyproj 2.2.0 and ran your script. No errors. Here's the output:
For the other one, I did get an error. Here's the output:
Hope this helps. |
Thanks for trying out the code snippet. One thing that would be good to rule out is potential issues with shapely. Can you try:
See: shapely/shapely#651 |
Also likely related: shapely/shapely#735 (comment) |
I get |
Not sure if it is related or not, but I see:
When the pyproj included version is:
|
Not likely. If 2.1.3 worked, it contained: |
@weatherfrog @juanfrans mind trying one of these: Python 2.7:
Python 3.5:
Python 3.6:
Python 3.7:
|
Closing for preference to #368 |
Fix in soon to be released 2.3.1 |
Geopandas object
to_crs
results in a691 segmentation fault
and crashes python.Here's my python code:
I'm working with
pyproj 2.2.0
installed with pip. My version of python was installed with homebrew.Thank you!
And here's the full crash report:
The text was updated successfully, but these errors were encountered: