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.
ChangeLog
1.4.0
Alias and deprecate RTreeError #33
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
required positional argument for wheel.425tags.get_platform() https://github.com/hobu/mgrs/pull/24
1.3.4
Truncate, don’t round results https://github.com/hobu/mgrs/pull/15
Apply license
1.3.3
SOABI support #10 https://github.com/hobu/mgrs/pull/10
Clean up some compilation warnings
Travis builds https://travis-ci.org/hobu/mgrs
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for mgrs-1.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82524e10e42322aa1470c72859908b25b15a234c120a6849ab9d7ac40383eba |
|
MD5 | 9725a5426f4e9926c79ccd95ca9d29ab |
|
BLAKE2b-256 | 091b2e1328c1402217d2d9ba3eccfa8b53cfd09c9d0671e93b647fef231e8976 |
Hashes for mgrs-1.4.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8ab0fdcb4235f7a7ab50fae3ed57a8763007505657f55cbc0066e9f104f8b2 |
|
MD5 | 3d651c94252de718a30545ca35a9d9b0 |
|
BLAKE2b-256 | c663837999477b65e9e815526d514bef1d0ea87f1a615adec1acc739218230a2 |
Hashes for mgrs-1.4.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd7e78d63ca73e7340076ebdaf497a1b76432cc65d8994efb02c3f1cbc4301ac |
|
MD5 | d7b67fd5ae22899a24eddd4d1e570c7f |
|
BLAKE2b-256 | 2654a28bf31f54d8704afd95a2e8b3cc1ba3893affbfd98b65406e226e2511ba |
Hashes for mgrs-1.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd08782887baf09fb426aae4892a57f681e4aebd60e0bcd35e7bb9826cf08109 |
|
MD5 | 61932ab79428a8522b0607fa4c17d36c |
|
BLAKE2b-256 | a33c3692ef49b6da8f24e11034a00d3728a86addf2488231dc4104b99f143735 |
Hashes for mgrs-1.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5843e5aab8ed0dc479536fc00eb244f9f5ea97e67abf6523134484a826b78393 |
|
MD5 | be97849a7d02d7fa303ca1a4095afd48 |
|
BLAKE2b-256 | e416d7f14c8e92da53798396428d715ba161bfbff1f7c2db0ec9d796e1354308 |
Hashes for mgrs-1.4.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e376454b299c76e9ee19ed2b4e6929952adda3450be258f1179beb66946b4012 |
|
MD5 | 257cd318a14b9641a7dc6ec665badcb4 |
|
BLAKE2b-256 | 792f05f595898aa947d0f310897ac8c7f4dda91f26bb82ab8fbd6e433288ee7b |
Hashes for mgrs-1.4.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3e086a90c086109096a6096963ae9397c29dc5136319906e122d58473a28a6d |
|
MD5 | a900e0a07f7a973521ec917f5530689f |
|
BLAKE2b-256 | 9cd6a3bf26609ee77dd80219ff0948fa1b67ece75d00c274e4c535d7a69c16a5 |
Hashes for mgrs-1.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdebd39056d0cb414d895283c08630a004b444f9f1dab76ce55d870e6942caac |
|
MD5 | 70f8d988fd1f2726621c8d86bda91dad |
|
BLAKE2b-256 | 8e051a6a87c992942b137a3a2b42101b85c708983b4306cc27e59cc9650dbfcc |
Hashes for mgrs-1.4.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c99877bfe8ba68d94bc0c1bc73b8401cce558fe767bf14df20031c916aa9088 |
|
MD5 | 686f226a6fe51e7923d6b4269ee34fa1 |
|
BLAKE2b-256 | ba3951c5e2accef328392facfa98ad9a5c369918f6ff4283284adc4c8f394ceb |