Turbo87 / utm

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

Why is UTM zone letter required for utm -> lat, lon conversion? #5

Closed exfizik closed 10 years ago

exfizik commented 10 years ago

I need to do utm to lat,lon conversions, but all I have is utm X, Y and zone number. Currently, there doesn't seem to be a way to do this conversion without knowing the zone letter. Is there a way around it? According to Wikipedia: "A position on the Earth is given by the UTM zone number and the easting and northing coordinate pair in that zone."

Turbo87 commented 10 years ago

see https://github.com/Turbo87/utm/blob/master/utm/conversion.py#L55-L56

basically it is only needed to determine if it is the northern or southern hemisphere, but for symmetric reasons I used the zone letter. we could however make the zone letter optional if something like a northern or southern parameter is set. something like lat, lon = to_latlon(easting, northing, zone_number, northern=True)

exfizik commented 10 years ago

I think that would be the best solution. Thanks!