Turbo87 / utm

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

no attribute 'from_latlon' #43

Closed fatgenius closed 5 years ago

fatgenius commented 5 years ago
File "utm.py", line 4, in <module>
    import utm
  File "/home/tea/Desktop/utm.py", line 9, in <module>
    u = utm.from_latlon(30.44085275, 103.58441172)
AttributeError: 'module' object has 
Turbo87 commented 5 years ago

sorry, I don't know what this means. the error is incomplete and with incomplete information we can't attempt to fix this.

LuxMiranda commented 5 years ago

Try

from utm.conversion import from_latlon

instead.

fatgenius commented 5 years ago

sorry, I don't know what this means. the error is incomplete and with incomplete information we can't attempt to fix this.

thanks so much. already solved problem. but new question coming up.Could you help me? thanks in advance. utm.from_latlon(3044.2543894,10358.3156079) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/utm/conversion.py", line 190, in from_latlon raise OutOfRangeError('latitude out of range (must be between 80 deg S and 84 deg N)') utm.error.OutOfRangeError: latitude out of range (must be between 80 deg S and 84 deg N)

I`m current testing the code in china, any location problems? Thanks again

Turbo87 commented 5 years ago

3044.2543894 is not a valid latitude values as the error mentions, they must be between 84 and -80 and 3044 is outside of that range.

fatgenius commented 5 years ago

3044.2543894 is not a valid latitude values as the error mentions, they must be between 84 and -80 and 3044 is outside of that range.

Thanks again, The data type I been using is GNGLL. Any way could convert it to the require data type? Dank.

Turbo87 commented 5 years ago

The data type I been using is GNGLL.

I've never heard of GNGLL, sorry.