Turbo87 / utm

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

Borders of zones 31V and 32V #15

Closed Hubble1942 closed 8 years ago

Hubble1942 commented 8 years ago

In latlon_to_zone_number you handle the zones 31V and 32V different from all the other zones.

Usually, you compute the zone number [left..right) and the zone letter [bottom..top). But for the corrections of 31V and 32V you use [left..right] and [bottom..top].

This leads to the following behavior:

I would replace line 179 by

if 56 <= latitude < 64 and 3 <= longitude < 12:

I didn't check your code for the corrections in the X-band in detail. (I'm not interrested in places this far north...) But I believe, we have the same issue there.

Turbo87 commented 8 years ago

@Hubble1942 could you prepare a pull request with your fix and possibly a unit test to reproduce the problem?