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
The CRS information is not stored on the geometry level but for the whole GeometryArray. GeoPandas has never passed CRS information as SRID onto geometries. Given you can work with custom projections defined as pyproj.CRS which cannot be expressed as SRID integer, we would often run into trouble trying to do that. Not mentioning the likely performance issue.
If you want to set SRIDs, you can do that using shapely.set_srid. But the fact that the geometries do not have SRID at the moment is not a bug but an expected behaviour.
martinfleis
changed the title
BUG: CRS from GeoDataFrame not passed on to individual geometry objects
ENH: CRS from GeoDataFrame not passed on to individual geometry objects
May 7, 2024
[✅ ] I have checked that this issue has not already been reported.
[✅ ] I have confirmed this bug exists on the latest version of geopandas.
[❌] (optional) I have confirmed this bug exists on the main branch of geopandas.
Code Sample, a copy-pastable example
Output
Problem description
The GDF has the correct CRS but the individual geometry objects themselves do not.
Expected Output
This seems odd. I would expect each geom object to have the same CRS as the gdf.
Output of
geopandas.show_versions()
SYSTEM INFO
python : 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
executable : C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\big-bertha-O8kHtzvf-py3.10\Scripts\python.exe
machine : Windows-10-10.0.22631-SP0
GEOS, GDAL, PROJ INFO
GEOS : 3.11.3
GEOS lib : None
GDAL : 3.6.4
GDAL data dir: C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\big-bertha-O8kHtzvf-py3.10\lib\site-packages\fiona\gdal_data
PROJ : 9.3.0
PROJ data dir: C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\big-bertha-O8kHtzvf-py3.10\lib\site-packages\pyproj\proj_dir\share\proj
PYTHON DEPENDENCIES
geopandas : 0.14.4
numpy : 1.26.4
pandas : 2.1.3
pyproj : 3.6.1
shapely : 2.0.4
fiona : 1.9.6
geoalchemy2: None
geopy : None
matplotlib : 3.8.4
mapclassify: 2.6.1
pygeos : None
pyogrio : 0.7.2
psycopg2 : None
pyarrow : None
rtree : 1.2.0
The text was updated successfully, but these errors were encountered: