Turbo87 / utm

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

Zone number ignored near equator #17

Open jeremy-faller opened 8 years ago

jeremy-faller commented 8 years ago

Tried the following:

>>> utm.conversion.from_latlon(0.001,0.001)
(166132.8718804731, 110.68265407867526, 31, 'N')
>>> utm.conversion.from_latlon(-0.001,-0.001)
(833867.1281195269, 9999889.317345921, 30, 'M')
>>> utm.conversion.from_latlon(-0.001,-0.001,31)
(165910.01447681867, 9999889.317142073, 31, 'M')

You'll note the zone number is ignored. I believe this is a generic problem in that we can't pass the zone_letter to the from_latlon function.

Turbo87 commented 8 years ago

sorry, I don't understand the problem here. in the third call you force the zone number to be 31 and the result shows 31. what is wrong with that?

Turbo87 commented 8 years ago

maybe @tibnor can help here since he wrote that part of the code in #8

jeremy-faller commented 8 years ago

When you set the zone to 31, in my mind, the UTM coordinates should be

10000000-9999889=-111 and similarly for the other coordinate.

tarnhold commented 7 years ago

Zone numbers increase from west to east.

With 10.000.000 you mean the Northing, which is correct.

north of equator utm.conversion.from_latlon(0.001, 0) (166021.44322995137, 110.68275598603395, 31, 'N')

south of equator utm.conversion.from_latlon(-0.001, 0) (166021.44322995137, 9999889.317244014, 31, 'M')

south of equator, force zone 31 utm.conversion.from_latlon(-0.001, 0, 31) (166021.44322995137, 9999889.317244014, 31, 'M')

south of equator, force zone 30 - you see that only Easting changed utm.conversion.from_latlon(-0.001, 0, 30) (833978.5567700486, 9999889.317244014, 30, 'M')