Turbo87 / utm

Bidirectional UTM-WGS84 converter for python
http://pypi.python.org/pypi/utm
MIT License
493 stars 101 forks source link

Convertion of Gauss-Krueger coordinates #79

Open jnphilipp opened 2 years ago

jnphilipp commented 2 years ago

I'm trying to change the calculation, so that I can convert Gauss-Krueger coordinates. As far as I understand the difference is only that they use a different ellipsoide, i.e. Bessel in stead of WGS84, and the zones are 3° wide instead of 6°.

So I changed:

E = 0.006674372230688468
R = 6377397.155

def latlon_to_zone_number(latitude, longitude):
    ...
    return int((longitude + 180) / 3) + 1

def zone_number_to_central_longitude(zone_number):
    return (zone_number - 1) * 3 - 180 + 1.5

But my coorfiantes are way off:

from_latlon(50, 10)
464170.9085434285 5538183.190657409
# excpected
3571770.862 5540886.852

What am I missing?