Skip to main content

MGRS coordinate conversion for Python

Project description

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.

travisstatus

ChangeLog

1.3.7

  • automated building of osx, linux and win64 wheels

  • Migrate from TravisCI => GitHub Actions

  • Warnings cleanup

  • flake8 validation

1.3.6

1.3.4

1.3.3

1.3.2

  • Better Windows support

  • Bug fix for 3 digit longitudes

1.3.1

  • Python 3.x support

  • Allow user to override precision in UTMToMGRS

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mgrs-1.3.7.tar.gz (30.4 kB view details)

Uploaded Source

Built Distributions

mgrs-1.3.7-cp38-cp38-win_amd64.whl (22.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl (46.8 kB view details)

Uploaded CPython 3.8

mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl (21.1 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

mgrs-1.3.7-cp37-cp37m-win_amd64.whl (22.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl (46.8 kB view details)

Uploaded CPython 3.7m

mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl (21.1 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

mgrs-1.3.7-cp36-cp36m-win_amd64.whl (22.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl (46.8 kB view details)

Uploaded CPython 3.6m

mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl (21.1 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

Details for the file mgrs-1.3.7.tar.gz.

File metadata

  • Download URL: mgrs-1.3.7.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7.tar.gz
Algorithm Hash digest
SHA256 34c3a7dcd0bc77ecac46a9543ccfe88062bebbad5341a25e33e2b22cce5db307
MD5 14ca98ede85a87d0dfb5d4c50eb80dd1
BLAKE2b-256 b29f7d676a9ebbe5c89a174eaf286d1489bbcf5dcf3a6fc807ae50f6e2221a88

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d89a652cf7f45480030383009e4826e3224511ac7c32922efd8a34278d8f8fd5
MD5 505718e14036aab3ba56ec3e846812d1
BLAKE2b-256 767e4101abd02d07e3eceeb5c760dd84c951131d51b233cc7dd8e827884921a8

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e9be4331ee79bc59bb4dffc680300963b791dc469df7bf507a29abf5b257fb9c
MD5 208926d729564422c3a70ea1d032c65d
BLAKE2b-256 ff18d85ad7a2d019704820cc20c3636b32b8afe07833398f28b04c0186f8f895

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6c9264635aba9bdc1f7b843b1dd616592d426f8b9a14d02d9af008ace899a06c
MD5 870f619ed4ceee785eac09aea5fb4a3a
BLAKE2b-256 7c63d215bc61b58410d4646aa1306a94ea165efe136b0b6d5a2cd6418cec0e15

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d0caf45ab2c80b9a113619e7c86a7448682088dd12b2de1576f74ea916f1b9cf
MD5 6de7b0152a791355a13d3daccccc0144
BLAKE2b-256 54137a5b13a435799a634da8cae86ae7c181d970d37a571ef6223d9ee3be96a2

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 87b8078bfa9adf25f757db9fca94879a379d76d346133d06779017d56cb184c4
MD5 73de87a742d62cd064aab2017fcbc292
BLAKE2b-256 f4300b983848525b083c05d5912933c35d135f26792862cb0cb15f1f7ea96d1e

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d21dc727df22abbb619bb5674bc546b1e90659c8f5b932c38d2b6aec549f8aff
MD5 87a97ee113fc869c9f94d1ec9e439de3
BLAKE2b-256 f677cc59e3d41f538cae85a642fee204fd2adda1ae234128b7cbcbd4ff52d8c1

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 450d254583d7ac2c7b20c3fd2ed132b69b77f37d8e29b995715fa45b50a8852c
MD5 ed4c410d33bcdc7f2ea4500ae3513730
BLAKE2b-256 0e21685a6d6f0a318b461ad13ed48890e021de3b16f77ed252ced5b3f0ea0dda

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b29f778a8192aeb5c2129be62902b77083e411dd79938751d38939c95f6edbb
MD5 c31d181941c9b4a453ed137683f93a3c
BLAKE2b-256 f0620be2e07ca9ab73aa989d5aa3b9f1fe102cd2d5a0602b0154c35f73045e51

See more details on using hashes here.

File details

Details for the file mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

File hashes

Hashes for mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c7e937b18c67e0634438542f5bbc899a38b310d4815ec75d9c43f412b183ef4f
MD5 44c7bd2b411dbc9026bec740d926d916
BLAKE2b-256 4866d6f341df323ecaf7451f2f286d7d135f86b7bfa3e61cb2a099a927a3be50

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page