Segmentation Fault on pyproj.transform
See original GitHub issueI’m trying to convert a shapely polygon to a different CRS using a transformer:
import pyproj
from shapely.ops import transform
import shapely.wkt
poly = shapely.wkt.loads("POLYGON((11.32494067504356 48.81382282568276,10.760727610912785 48.03424052262582,12.501645259614333 47.67215127486503,13.38216064327573 48.133953565438105,11.32494067504356 48.81382282568276,11.32494067504356 48.81382282568276))")
transformer = pyproj.Transformer.from_crs("EPSG:4326", "EPSG:32631", always_xy=True)
img_poly = transform(transformer.transform, poly)
However, this is giving me a segmentation fault, without being able to know anything else. When I activated faulthandler following this old bug https://github.com/pyproj4/pyproj/issues/8, i obtained:
File "/opt/homebrew/lib/python3.9/site-packages/shapely/geometry/polygon.py", line 54 in __init__
File "/opt/homebrew/lib/python3.9/site-packages/shapely/ops.py", line 304 in transform
File "/Users/me/Documents/test.py", line 197 in <module>
zsh: segmentation fault python3 test.py
Environment Information
(I’m using M1 Mac, just in case) pyproj info: pyproj: 3.3.1 PROJ: 8.2.0 data dir: /opt/homebrew/lib/python3.9/site-packages/pyproj/proj_dir/share/proj user_data_dir: /Users/me/Library/Application Support/proj PROJ DATA (recommended version): 1.8 PROJ Database: 1.2 EPSG Database: v10.038 [2021-10-21] ESRI Database: ArcMap 12.8 [2021-05-06] IGNF Database: 3.1.0 [2019-05-24]
System: python: 3.9.13 (main, May 24 2022, 21:13:51) [Clang 13.1.6 (clang-1316.0.21.2)] executable: /opt/homebrew/opt/python@3.9/bin/python3.9 machine: macOS-12.3.1-arm64-arm-64bit
Python deps: /opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_distutils_hack/init.py:30: UserWarning: Setuptools is replacing distutils. warnings.warn(“Setuptools is replacing distutils.”) certifi: 2022.06.15 Cython: None setuptools: 62.3.2 pip: 22.1.1
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
I think I’ve found the problem: https://github.com/shapely/shapely/issues/1449#issuecomment-1219582201
Looks like they have a similar issue without pyproj. Going to close this as I believe it is a better fit in shapely.