Turbo87 / utm

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

Fix zone letter functionality #12

Closed psotres closed 8 years ago

psotres commented 9 years ago

Fixes #11

Turbo87 commented 9 years ago

you are correct that the latitude_to_zone_letter() function is a bit broken since it doesn't work for A, B, Y and Z (http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#Latitude_bands_2).

since the X zone ends at 84°N I'm not sure whether it is actually included or not. so you have any reference documentation that clear this up?

psotres commented 9 years ago

Here you can see some documentation: http://geokov.com/education/utm.aspx

"The northernmost band (X) is 12° latitude high instead of 8° and extends from 72°N to 84°N latitudes."

It does not explicitly mention that 84ºN is included on X band (or 80ºS included on C band). However, my understanding is that they are included because every lat/long point in the map has to have a UTM equivalent zone.

psotres commented 9 years ago

By the way, just to avoid opening another pull request, could you include on the __init__.py file both latlon_to_zone_number and latitude_to_zone_letter methods? They are very interesting for just evaluating if 2 different coordinates lies on the same UTM plane without needing to do the whole UTM conversion.