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
{{ message }}
Repository navigation
geopandas 1.1.2 fails at u_coord.get_resolution for EPSG 4087 #1351
note: atm (2026-11-06) geopandas 1.2 is not available from conda-forge for windows
Cause
There is apparently a bug in geopandas 1.1.4 or one of its dependencies.
The transformation from epsg 4326 to epsg 4087 is supposed to keep equal distances equal. A difference of one degree should result in a distance of 111319.5 meters, no matter where. But for latitudes, it doesn't.
The bug is apparently already fixed for geopandas 1.2 (at least for Linux).
For windows users: be aware of the small (though significant) discrepancy and update the environment once geoppandas 1.2 is availble.
If this is a concern, perhaps downgrading geopandas might help. (I do currently not know which versions below 1.1.2 are not affected. Sorry.)
@emanuel-schmid Are you sure this is unexpected? Both of these CRSs are based on WGS84, which implements a spheroid as Earth reference shape, meaning that different latitudes are indeed expected to differ in their distance: https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84 Constant distances would be expected for fixed latitudes and differing longitudes
I suppose they had their reasons but to me, it's kind of hard to grasp. Wasn't the 4087 projection meant to strictly assign the same amount of meters to 1°?
I mean, for the longitudes, they don't mind the shape of earth at all. Why for latitudes?
And even so - the other way around would seem to make more sense: 1° at the equator has more meters than 1° at the pole.
🤦 I think I got it: the angle is not defined by the direction to the center of the earth but by an "orthogonal to the horizon" - right? Than it all makes sense!
This is not the default setting and I doubt anyone is using it. Shall we just remove the approx option for coordinate matching and the degree_to_km function? I don't see a purpose in it. After the PROJ update, the test fixed in #1359 also does not make sense anymore.
Activity
peanutfun commentedon Nov 10, 2026
Do you have a reference for the bug? I still see it on Ubuntu, Python 3.12/3.13, GeoPandas v1.2: https://github.com/CLIMADA-project/climada_python/actions/runs/42808263740/job/129802888617?pr=1286
peanutfun commentedon Nov 10, 2026
@emanuel-schmid Are you sure this is unexpected? Both of these CRSs are based on WGS84, which implements a spheroid as Earth reference shape, meaning that different latitudes are indeed expected to differ in their distance: https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84 Constant distances would be expected for fixed latitudes and differing longitudes
peanutfun commentedon Nov 10, 2026
Meanwhile,
degree_to_kmexplicitly works under the assumption of a spherical earth:climada_python/climada/util/coordinates.py
Line 1137 in cc0b215
emanuel-schmid commentedon Nov 10, 2026
@peanutfun it's sure unexpected to me 😁
The expected behavior was:
as for python 3.11, geopandas 1.2 and its dependencies
So, perhaps the "bug" (if it is one) does not disappear but emerge...
emanuel-schmid commentedon Nov 10, 2026
turns out that the proj library underneath changed between 3.7.1 and 9.8.1.
up to proj 3.7 this prints
111319.49079327357starting from proj 3.8
110574.38855779878emanuel-schmid commentedon Nov 10, 2026
I suppose they had their reasons but to me, it's kind of hard to grasp.
Wasn't the 4087 projection meant to strictly assign the same amount of meters to 1°?I mean, for the longitudes, they don't mind the shape of earth at all. Why for latitudes?
And even so - the other way around would seem to make more sense: 1° at the equator has more meters than 1° at the pole.
🤦 I think I got it: the angle is not defined by the direction to the center of the earth but by an "orthogonal to the horizon" - right? Than it all makes sense!
emanuel-schmid commentedon Nov 10, 2026
As they think it's correct this way, we'll update the test.
see OSGeo/PROJ#4860
peanutfun commentedon Nov 11, 2026
Always honour your ellipsoids! OSGeo/PROJ#4860 (comment)
peanutfun commentedon Nov 25, 2026
The only instance where we use
degree_to_kmis when using theapproxmethod for nearest neighbor matching of coordinates:climada_python/climada/util/coordinates.py
Line 1301 in cc0b215
This is not the default setting and I doubt anyone is using it. Shall we just remove the
approxoption for coordinate matching and thedegree_to_kmfunction? I don't see a purpose in it. After the PROJ update, the test fixed in #1359 also does not make sense anymore.