
=========
PyGeodesy
=========

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_ using Python 3.7.0, both in 64-bit on macOS 10.13.6
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.6 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.1 (iPad and iPhone X).

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, macOS 10.13.4 and/or 10.13.5 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, with 32-bit Python 2.7.14 on Windows 10 Pro and
with 64-bit Python 3.7.0 on Debian GNU/Linux 9.

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: Sep 08, 2018.*

.. _checked: http://github.com/ActiveState/code/tree/master/recipes/Python/546532_PyChecker_postprocessor
.. _docs: http://www.movable-type.co.uk/scripts/geodesy/docs/
.. _documentation: http://mrjean1.github.io/PyGeodesy/
.. _Epydoc: http://pypi.python.org/pypi/epydoc
.. _Flake8: http://pypi.python.org/pypi/flake8
.. _geographiclib: http://pypi.python.org/pypi/geographiclib
.. _Geohashes: http://www.movable-type.co.uk/scripts/geohash.html
.. _GitHub: http://github.com/mrJean1/PyGeodesy
.. _Intel-Python: http://software.intel.com/en-us/distribution-for-python
.. _JavaScript originals: http://github.com/chrisveness/geodesy
.. _JavaScript source: http://github.com/chrisveness/geodesy
.. _John P. Snyder: http://pubs.er.USGS.gov/djvu/PP/PP_1395.pdf
.. _Latitude/Longitude: http://www.movable-type.co.uk/scripts/latlong.html
.. _McCabe: http://pypi.python.org/pypi/mccabe
.. _MGRS: http://www.movable-type.co.uk/scripts/latlong-utm-mgrs.html
.. _MIT License: http://opensource.org/licenses/MIT
.. _numpy: http://pypi.python.org/pypi/numpy
.. _NumPy array: http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
.. _OSGR: http://www.movable-type.co.uk/scripts/latlong-os-gridref.html
.. _PyPI: http://pypi.python.org/pypi/PyGeodesy/
.. _PyChecker: http://pypi.python.org/pypi/pychecker
.. _PyCodeStyle: http://pypi.python.org/pypi/pycodestyle
.. _PyFlakes: http://pypi.python.org/pypi/pyflakes
.. _PyGeodesy: http://pypi.python.org/pypi/PyGeodesy
.. _PyPy-Python: http://pypy.org
.. _Pythonista 3.2: http://omz-software.com/pythonista
.. _Ramer-Douglas-Peucker: http://wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
.. _Reumann-Witkam: http://psimpl.sourceforge.net/reumann-witkam.html
.. _simplify: http://bost.ocks.org/mike/simplify
.. _UTM: http://www.movable-type.co.uk/scripts/latlong-utm-mgrs.html
.. _Vector-based: http://www.movable-type.co.uk/scripts/latlong-vectors.html
.. _Vincenty: http://www.movable-type.co.uk/scripts/latlong-vincenty.html
.. _Visvalingam-Whyatt: http://hydra.hull.ac.uk/resources/hull:8338
.. _Web Mercator: http://wikipedia.org/wiki/Web_Mercator

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