Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know of any packages out there that implement a pure python method to convert lat/long coordinates to MGRS coordinates?

PyPi has a package, but it requires some c-extensions from another source, and I didn't want to use that. I figured before I go an recreate a complicated process, I'm hoping the community can make my life a tad easier.

Thanks everyone!

share|improve this question
Is this the pypi package you are referring to? – Chad Cooper Feb 10 '12 at 15:24
Yep, this is the pypi package I am talking about. – Josh Feb 10 '12 at 16:18
The GeoTrans C extensions come bundled in the package and are free to use. Is usage the issue? – Chad Cooper Feb 10 '12 at 16:25
I am also looking for better solution to this problem with C code I am trying to install the package PyPi packagehowever, stuck with C lib unavailability on my system Can someone help in solving the problem, Getting C error with: # python install `running install running bdist_egg running egg_info writing requirements to mgrs.egg-info/requires.txt writing mgrs.egg-info/PKG-INFO writing top-level names to mgrs.egg-info/top_level.txt writing dependency_links to mgrs.egg-info/dependency_links.txt reading manifest file 'mgrs.egg-info/SOURCES. – shashankS Sep 1 '15 at 11:19

I'm the developer of the PyPI package. You could simply port the GeoTRANS code that lives in this package to Python if you want a pure-Python extension. Do you want to use this on AppEngine or something? Otherwise, a ctypes wrapper to a C extension that you don't have to worry about at all with pre-compiled versions for Windows is as good as it'll get...

share|improve this answer
Howard, Can you post a link to the c-code? Thanks Josh – user5915 Feb 13 '12 at 12:00
Josh, if you pull the .tar.gz file of the PyPI package, the C files are in there to just do the MGRS. Note that there's a lot of trig and other messy math :) – Howard Butler Feb 15 '12 at 2:57
Thanks Howard. I'll let you know how I do. I can't post a comment I noticed once some person determined this question was answered. – josh1234 Feb 15 '12 at 11:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.