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.9

  • MGRS now requires packaging library #31

  • Fix wheel imports of shared libs

1.3.8

  • UTF-8 encoding for all strings.

  • Fix #29 implicit tuple on return of UTMToMGRS

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.9.tar.gz (31.5 kB view details)

Uploaded Source

Built Distributions

mgrs-1.3.9-cp38-cp38-win_amd64.whl (23.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl (47.3 kB view details)

Uploaded CPython 3.8

mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl (21.6 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

mgrs-1.3.9-cp37-cp37m-win_amd64.whl (23.0 kB view details)

Uploaded CPython 3.7m Windows x86-64

mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl (47.3 kB view details)

Uploaded CPython 3.7m

mgrs-1.3.9-cp37-cp37m-macosx_10_14_x86_64.whl (21.6 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

mgrs-1.3.9-cp36-cp36m-win_amd64.whl (23.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl (47.3 kB view details)

Uploaded CPython 3.6m

mgrs-1.3.9-cp36-cp36m-macosx_10_14_x86_64.whl (21.6 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mgrs-1.3.9.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9.tar.gz
Algorithm Hash digest
SHA256 123d0e1b0a052fc47e0f006f5403bd7f397947228297356e44b463db16a25dd5
MD5 d82bf5a5bc17b38e6de01d21039630d3
BLAKE2b-256 6f6f48ba7d68f4bb2fff397540348f626fbd763ffa4b412ff2123ecb09c0eb0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 23.0 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d4996fe7f3bb6cf00aba0141864803b0c6bcb7393dd57fbd02cf34bc2fff0486
MD5 7bac0759ff97ba27fdb4382d06a28859
BLAKE2b-256 b6eabe3bcb2b495ad160d990b8c9f15819c86edb0ba52116dc32bb0dc185a32d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 47.3 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0396f7e5754a5fa665da683533339a3ce3b0131dc707c672032e0088a241535f
MD5 16f05fed3e37adc897d8f8e2731cd613
BLAKE2b-256 6611a03f9e5c15d798dd2b45f1dc56a4ffe8c3d70526f9ee8f4f1319168c66b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.6 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 18c51baeffedbffa4df4f3110899d36f203aa4d7b048338227d11fd1a9ffa740
MD5 e943e3b8f9ee9ff0a3b27efd6a941826
BLAKE2b-256 b522f42f9bc35f6c61fb4a4863ae6fb793dfdd7bade0de5e4774780b4df1228e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 23.0 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2be9a1d3a0f1bcda94e5db51322205160c86e770a5cfb7eda50dc4363fd0b9fc
MD5 cbc61abe1f734edaf66e5b80404f4887
BLAKE2b-256 d8f945ff7c95a5e1e114317cec058dc7bdacfd4f2502be7b7515ef40d4eee591

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 47.3 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 658408e79c3a354f65312b6a756ad5f8f4b984d175eca0c5b2b8a61053def731
MD5 3945a9f18845feb88db1849ef7035c86
BLAKE2b-256 3e78debf32295aefff2cf554b0ccbde0036efcfa224627f32ef1d12c93602ad5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.6 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 33c19bd6b9e73ef32cb4bbd76a78b1b45cfcb0e7daa0c6c7c3af6cff417bd9ed
MD5 a583cc232aa61dcfd8eed513ed4457d5
BLAKE2b-256 edc0b77168f831b43041327d5922a4be2040651ef1be23d35310e3d07810c96e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 23.0 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2245d169cf7edf03bd4ec4e784beed719b8605daac53a4992c4aa272c9c00433
MD5 950a023b234d52d600fab6aaae9f71d8
BLAKE2b-256 f323163dbe42080cb1392c40c7f136435f0ba236495b955e481d2de6c3d0eb79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 47.3 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c785d05e88d09242f883d48085adc993c6b680284eec53779257c7c3b1a97d8b
MD5 05ed9645deb83da86befbc2d95bb4ff7
BLAKE2b-256 f57dd859d943e39154436ecde21f381219bb1354c5d55b765b2788b14ac62ad1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgrs-1.3.9-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 21.6 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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for mgrs-1.3.9-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 259776ec8789c1f9c3bc317d8447f444ae75f1bfb57e993ab507192151f98217
MD5 c9d8509793b4e97d173087039b61e591
BLAKE2b-256 b9bbf3b64c4c12d2a9fd9370d60b82f206f740d82626189fff7def7716b4a30c

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