hobuinc / mgrs

Python MGRS library
https://pypi.python.org/pypi/mgrs
MIT License
111 stars 36 forks source link

Calling functions individually #18

Closed MM-California closed 6 years ago

MM-California commented 6 years ago

I am attempting to use .toLatLon() import mgrs m=mgrs.MGRS() m.toLatLon('some MGRS')

but get a tree error: --RTreeError: Error in "Convert_MGRS_To_Geodetic": MGRS Errors: String Error --

Am i doing something incorrect? When i run it with the Lat/Lon variables, then .toMGRS(); it works fine. Without it, doing it all together as in the example, it provides tree errors.

hobu commented 6 years ago

please provide a test case that fails.

Jeak commented 4 years ago

This still fails on mgrs 1.3.6:


>>> import mgrs
>>> m = mgrs.MGRS()
>>> c = '15TWG0000049776'
>>> c
'15TWG0000049776'
>>> d = m.toLatLon(c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/mgrs/__init__.py", line 98, in toLatLon
    core.rt.Convert_MGRS_To_Geodetic( c, plat, plon)
  File "/usr/local/lib/python3.7/dist-packages/mgrs/core.py", line 81, in check_error
    raise RTreeError(msg)
mgrs.core.RTreeError: Error in "Convert_MGRS_To_Geodetic": MGRS Errors: String Error