skip to navigation
skip to content

mgrs 1.0.1

MGRS coordinate conversion for Python

Downloads ↓

mgrs: Converting to and from MGRS and Decimal Degrees

GeoTrans provides C code for converting to and from MGRS, but well, it's C code :). This is a simple ctypes wrapper around two of the MGRS-related functions in GeoTrans.

This library has an internal copy of some of the files from GeoTrans 2.4.2.

Usage

In a nutshell:

>>> import mgrs

>>> latitude = 42.0
>>> longitude = -93.0

>>> m = mgrs.MGRS()
>>> c = m.toMGRS(latitude, longitude)
>>> c
'15TWG0000049776'

>>> d = m.toLatLon(c)
>>> d
(41.999997975127997, -93.000000000000014)

You can also control the precision of the MGRS grid with the MGRSPrecision arguments in .toMGRS(). Other than that, there isn't too much to it.

 
File Type Py Version Uploaded on Size # downloads
mgrs-1.0.1-py2.4-win32.egg (md5)
built on Windows-XP
Python Egg 2.4 2011-12-06 16KB 214
mgrs-1.0.1-py2.5-win32.egg (md5) Python Egg 2.5 2011-12-06 16KB 161
mgrs-1.0.1-py2.6-win32.egg (md5) Python Egg 2.6 2011-12-06 18KB 173
mgrs-1.0.1-py2.7-win32.egg (md5) Python Egg 2.7 2011-12-06 18KB 180
mgrs-1.0.1.tar.gz (md5) Source 2011-12-06 25KB 265
mgrs-1.0.1.win32-py2.4.exe (md5) MS Windows installer 2.4 2011-12-06 75KB 126
mgrs-1.0.1.win32-py2.5.exe (md5) MS Windows installer 2.5 2011-12-06 75KB 123
mgrs-1.0.1.win32-py2.6.exe (md5) MS Windows installer 2.6 2011-12-06 82KB 137
mgrs-1.0.1.win32-py2.7.exe (md5) MS Windows installer 2.7 2011-12-06 209KB 139