Turbo87 / utm

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

`utm.from_latlon` returns bogus zone 61 for `(0, 180)` #109

Closed PaarthShah closed 2 weeks ago

PaarthShah commented 12 months ago

Using utm==0.7.0:

utm.from_latlon(0, 180)
(166021.4431793313, 0.0, 61, 'N')

UTM Zone numbers are in range [1, 60].

Notably, check_valid_zone still works:

utm.check_valid_zone(61, 'N')
Traceback (most recent call last):
  File "<REDACTED>/.local/share/JetBrains/Toolbox/apps/pycharm-professional/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "<REDACTED>/venv/lib/python3.11/site-packages/utm/conversion.py", line 55, in check_valid_zone
    raise OutOfRangeError('zone number out of range (must be between 1 and 60)')
utm.error.OutOfRangeError: zone number out of range (must be between 1 and 60)