Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install mgrs

How to install mgrs

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install mgrs
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.1
1.1.0Never BuiltWhy not?
1.0.1 Available View build log
1.0 Failed View build log
Windows (64-bit)
1.0.1
1.1.0Never BuiltWhy not?
1.0.1 Available View build log
1.0 Failed View build log
Mac OS X (10.5+)
1.0.1
1.1.0Never BuiltWhy not?
1.0.1 Available View build log
1.0 Failed View build log
Linux (32-bit)
1.0.1
1.1.0Never BuiltWhy not?
1.0.1 Available View build log
1.0 Failed View build log
Linux (64-bit)
1.1.0 Available View build log
1.0.1 Available View build log
1.0 Failed View build log
 
Author
License
MIT
Dependencies
Imports
Lastest release
version 1.1.0 on Jan 9th, 2014

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)

>>> y = '321942.29N'
>>> yd = m.dmstodd(y)
32.328414

>>> d, m, s = m.ddtodms(32.328414)
>>> d, m, s
(32.0, 19.0, 42.290400)

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.

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.