Skip to main content

Pure Python geodesy tools

Project description

A pure Python implementation of geodesy tools for various ellipsoidal and spherical earth models using precision trigonometric, vector-based and approximate methods for geodetic (lat-/longitude) and geocentric cartesian (x/y/z) coordinates.

Transcribed from JavaScript originals by Chris Veness (C) 2005-2016 and published under the same MIT License.

There are two modules for ellipsoidal earth models, ellipsoidalVincenty and -Nvector and two for spherical ones, sphericalTrigonometry and -Nvector. Each module provides a LatLon class with methods and functions to compute distance, initial and final bearing, intermediate and nearest points, area, perimeter, conversions and unrolling, among other things. For more information and further details see the documentation, the descriptions of Latitude/Longitude, Vincenty and Vector-based geodesy and the original JavaScript source or docs.

Also included are modules for conversions to and from UTM (Universal Transverse Mercator) and Web Mercator (Pseudo-Mercator) coordinates, MGRS (NATO Military Grid Reference System) and OSGR (British Ordinance Survery Grid Reference) grid references and a module for encoding and decoding Geohashes.

Two other modules provide Lambert conformal conic projections and positions (from John P. Snyder, Map Projections – A Working Manual, 1987, pp 107-109) and several functions to simplify or linearize a path of LatLon points (or a NumPy array), including implementations of the Ramer-Douglas-Peucker, the Visvalingam-Whyatt and the Reumann-Witkam algorithms and modified versions of the former.

All Python source code has been statically checked with PyChecker, PyFlakes, PyCodeStyle (formerly Pep8) and McCabe using Python 2.7.15 and with Flake8 on Python 3.7.0, both in 64-bit on macOS 10.13.5 High Sierra.

The tests have been run in 64-bit with PyPy-Python 2.7.13, Python 2.7.15 (with geographiclib 1.49 and numpy 1.14.0), Intel-Python 3.5.3 (and numpy 1.11.3) and Python 3.7.0, all on macOS 10.13.5 High Sierra and with Pythonista 3.2 Python 2.7.12 and 3.6.1 (both with numpy 1.8.0) on iOS 11.4.

Previously, the tests were run with 64-bit Python 2.6.9 (and numpy 1.6.2), 2.7.10 (and numpy 1.8.0rc1), 2.7.13, 2.7.14 (and numpy 1.13.1), 3.5.3, 3.6.2, 3.6.3, 3.6.4, 3.6.5 on MacOS X 10.10 Yosemite, MacOS X 10.11 El Capitan, macOS 10.12 Sierra and/or macOS 10.13.4 High Sierra, with Pythonista 3.1 on iOS 10.3.3, 11.0.3, 11.1.2 and 11.3, with 32-bit Python 2.6.6 on Windows XP SP3 and with 32-bit Python 2.7.14 on Window 10 Pro.

In addition to the PyGeodesy package, the distribution files contain the tests, the test results and the complete documentation generated by Epydoc using command line: epydoc --html --no-private --no-source --name=PyGeodesy --url=... -v pygeodesy.

To install PyGeodesy, type pip install PyGeodesy or easy_install PyGeodesy in a terminal or command window. Alternatively, download PyGeodesy- from PyPI or GitHub, unzip the downloaded file, cd to directory PyGeodesy- and type python setup.py install. To run all PyGeodesy tests, type python setup.py test before installation.

Installation of NumPy and GeographicLib is optional, but the latter is required for two ellipsoidalVincenty functions, areaOf and perimeterOf.

Some function and method names differ from the JavaScript version. In such cases documentation tag JS name: shows the original JavaScript name.

Last updated: July 03, 2018.

Copyright (C) 2016-2018 -- mrJean1 at Gmail dot com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

PyGeodesy-18.7.3.zip (906.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyGeodesy-18.7.3-py2.py3-none-any.whl (153.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file PyGeodesy-18.7.3.zip.

File metadata

  • Download URL: PyGeodesy-18.7.3.zip
  • Upload date:
  • Size: 906.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyGeodesy-18.7.3.zip
Algorithm Hash digest
SHA256 17f4694a57547ff0a4bd0b6a1664a3c92f657992d4d0c812310fe5ee99362bae
MD5 550f819eb5b856accae522309f95bbca
BLAKE2b-256 6c1c431a96c41caa4f9aa154d38f86d8a9805e69b3439c39d51c4e2ed252e33e

See more details on using hashes here.

File details

Details for the file PyGeodesy-18.7.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for PyGeodesy-18.7.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 59d2b932fae4c71915ef5495a2d44ec3837752ad886a6dd66bdef272ed56cc6a
MD5 9641495370f30c662f8e0e8b386cd232
BLAKE2b-256 56a0de84a7e02dd3862f1e993571461d38b5ff4ea49e5faeba0becc77d8a8911

See more details on using hashes here.

Supported by

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