Home | Trees | Indices | Help |
|
---|
|
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 several C++ classes by Charles Karney (C) 2008-2017 and published under the same MIT License**.
There are three modules for ellipsoidal earth models, ellipsoidalKarney, -Vincenty 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, the original JavaScript source or docs and the Python GeographicLib.
Also included are modules for conversions to and from Cassini-Soldner, UPS (Universal Polar Stereographic), UTM (Exact and Universal Transverse Mercator) and Web Mercator (Pseudo-Mercator) coordinates, MGRS (NATO Military Grid Reference System) and OSGR (British Ordinance Survery Grid Reference) grid references, TRF (Terrestrial Reference Frames), and modules to encode and decode EPSG, Geohashes, Georefs (WGRS) and Garefs (GARS).
Other modules provide Lambert conformal conic projections and
positions (from John P. Snyder, "Map Projections -- A Working
Manual", 1987, pp 107-109), functions to clip a path or polygon
of LatLon
points using the Cohen–Sutherland and the Sutherland-Hodgman methods, 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 Reumann-Witkam the algorithms and modified versions of
the former and classes to interpolate the height of LatLon
points
and several Geoid
models.
To install PyGeodesy, type pip install PyGeodesy
or
easy_install PyGeodesy
in a terminal or command window.
Alternatively, download PyGeodesy-yy.m.d.zip
from PyPI or GitHub,
unzip
the downloaded file, cd
to directory
Pygeodesy-yy.m.d
and type python setup.py
install
. To run all PyGeodesy tests, type python setup.py
test
before installation.
Installation of GeographicLib, NumPy and SciPy is optional. However, the former is required
for module css
classes CassiniSoldner and Css and function
toCss and
for module ellipsoidalKarney classes LatLon
and
Cartesian
and functions areaOf
and
perimeterOf
. The latter are needed for the
Geoid...
and Height...
interpolators, except
GeoidKarney, HeightIDW, HeightIDW2 and HeightIDW3.
In addition to the PyGeodesy package, the distribution files contain the
tests, the test results (on macOS only) and the complete documentation (generated by Epydoc using
command line: epydoc --html --no-private --no-source
--name=PyGeodesy --url=... -v pygeodesy
).
The tests have been run with Python 2.7.16 and 3.7.3 (both with geographiclib 1.49, numpy 1.16.1 and scipy 1.2.1) and with PyPy 6.0.0 (Python 2.7.13 and 3.5.3) on macOS 10.13.6 High Sierra, all in 64-bit only. The results of those tests are included in the distribution files.
The tests also run with Python 2.6.9, 2.7.14, 3.5.6 and 3.6.3 (and geographiclib 1.49) on Ubuntu 14.04 and with Python 3.7.3 (and geographiclib 1.49) on Debian 9 all in 64-bit only and with Python 2.7.15, 3.6.8 and 3.7.2 (all with geographiclib 1.49) on Windows Server 2012R2 in both 32- and 64-bit.
On Python 3.7+, the tests run with and without lazy
import
.
A single file and single directory application with
pygeodesy
has been bundled using PyInstaller 3.4
and 64-bit Python 3.7.3 on macOS 10.13.6 High Sierra.
Previously, the tests were run with Python 2.6.9 (and numpy 1.6.2), 2.7.10 (and numpy 1.8.0rc1), 2.7.13, 2.7.14, 2.7.15 (and numpy 1.13.1, 1.14.0 or 1.15.2), 3.5.3, 3.6.2, 3.6.3, 3.6.4, 3.6.5, 3.7.0, 3.7.2 and Intel-Python 3.5.3 (and numpy 1.11.3) on MacOS X 10.10 Yosemite, MacOS X 10.11 El Capitan, macOS 10.12 Sierra, macOS 10.13.5 High Sierra and macOS 10.14 Mojave, with Pythonista 3.1 on iOS 10.3.3, 11.0.3, 11.1.2 and 11.3 on iPad4, with Pythonista 3.2 (with geographiclib 1.49 and numpy 1.8.0) on iOS 11.4.1, 12.0 and 12.2 on iPad4, iPhone7 and/or iPhone10, all in 64-bit only and with 32-bit Python 2.6.6 on Windows XP SP3 and with 32-bit Python 2.7.14 on Windows 10 Pro.
All Python source code has been statically checked with PyChecker, PyFlakes, PyCodeStyle (formerly Pep8) and McCabe using Python 2.7.16 and with Flake8 using Python 3.7.3, both in 64-bit on macOS 10.13.6 High Sierra.
Some function and method names differ from the JavaScript version. In such cases documentation tag JS name: shows the original JavaScript name.
**) Copyright (C) 2016-2019 -- 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.
Version: 19.06.29
Submodules | |
|
Classes | |
LazyImportError Lazy import is not supported, disabled or failed some other way. |
|
CrossError Error raised for zero or near-zero vectorial cross products, occurring for coincident or colinear points, paths or bearings. |
|
Epsg EPSG class, a _NamedInt .
|
|
EPSGError EPSG encode or decode error. |
|
Garef Garef class, a _NamedStr .
|
|
Geohash Geohash class, a _NamedStr. |
|
Georef Georef class, a _NamedStr .
|
|
VincentyError Error raised from Vincenty's direct and inverse methods for coincident points or lack of convergence. |
|
CassiniSoldner A Python version of Charles Karney's CassiniSoldner C++ class. |
|
Conic Lambert conformal conic projection (1- or 2-SP). |
|
Css Cassini-Soldner East-/Northing location. |
|
Datum Ellipsoid and transform parameters for an earth model. |
|
ETMError ETM parse, projection or other error. |
|
Ellipsoid Ellipsoid with major and minor radius, semi-axis, (inverse) flattening and other pre-computed, frequently used attributes. |
|
Elliptic Elliptic integrals and functions. |
|
EllipticError Elliptic integral, function, convergence or value issue. |
|
Etm Exact Transverse Mercator (ETM) coordinate, a sub-class of Utm, a Universal Transverse Mercator (UTM) coordinate using the ExactTransverseMercator projection for highest accuracy. |
|
ExactTransverseMercator A Python version of Karney's TransverseMercatorExact C++ class, a numerically exact transverse mercator projection, referred to as TMExact here.
|
|
Fdot Precision dot product. |
|
Fhorner Precision polynomial evaluation using the Horner form. |
|
Fpolynomial Precision polynomial evaluation. |
|
Fsum Precision summation similar to standard Python function math.fsum .
|
|
GeoidError Geoid interpolator or interpolation error. |
|
GeoidG2012B Geoid height interpolator for GEOID12B Model grids CONUS, Alaska, Hawaii, Guam and Northern Mariana Islands, Puerto Rico and U.S. Virgin Islands and American Samoa based on SciPy RectBivariateSpline or interp2d interpolation.
|
|
GeoidKarney Geoid height interpolator for Charles Karney's GeographicLib Earth Gravitational Model (EGM) geoid egm*.pgm datasets using bilinear or cubic interpolation and caching in pure Python transcribed from Karney's C++ class Geoid. |
|
GeoidPGM Geoid height interpolator for Charles Karney's GeographicLib Earth Gravitational Model (EGM) geoid egm*.pgm datasets but based on SciPy
RectBivariateSpline or interp2d interpolation.
|
|
HeightCubic Height interpolator based on SciPy interp2d kind='cubic' .
|
|
HeightError Height interpolator or interpolation error. |
|
HeightIDW Height interpolator using Inverse Distance Weighting (IDW) and the angular Euclidean distance from function euclidean_.
|
|
HeightIDW2 Height interpolator using Inverse Distance Weighting (IDW) and the equirectangular distance (in radians squared) like
function equirectangular_.
|
|
HeightIDW3 Height interpolator using Inverse Distance Weighting (IDW) and the angular Haversine distance from function haversine_.
|
|
HeightLSQBiSpline Height interpolator using SciPy LSQSphereBivariateSpline.
|
|
HeightLinear Height interpolator based on SciPy interp2d kind='linear] .
|
|
HeightSmoothBiSpline Height interpolator using SciPy SmoothSphereBivariateSpline.
|
|
LatLon2psxy Wrapper for LatLon points as "on-the-fly"
pseudo-xy coordinates.
|
|
LatLonHeightBase (INTERNAL) Base class for LatLon points on spherical
or ellipsiodal earth models.
|
|
LatLon_ Low-overhead LatLon class for Numpy2LatLon and Tuple2LatLon.
|
|
Lcc Lambert conformal conic East-/Northing location. |
|
LimitError Error raised for lat- or longitudinal deltas exceeding the limit in functions equirectangular and equirectangular_.
|
|
Mgrs Military Grid Reference System (MGRS/NATO) references, with method to convert to UTM coordinates. |
|
Numpy2LatLon Wrapper for NumPy arrays as "on-the-fly"
LatLon points.
|
|
Osgr Ordinance Survey Grid References (OSGR) coordinate. |
|
PGMError Error parsing or cropping an egm*.pgm geoid dataset.
|
|
RangeError Error raised for lat- or longitude values outside the clip , clipLat ,
clipLon or limit range in
function clipDMS, parse3llh, parseDMS
or parseDMS2.
|
|
RefFrame Terrestrial Reference Frame (TRF). |
|
RefFrameError Reference frame or conversion issue. |
|
SciPyError Error raised for SciPy errors.
|
|
SciPyWarning Exception thrown for SciPy warnings.
|
|
Transform Helmert transformation. |
|
Tuple2LatLon Wrapper for tuple sequences as "on-the-fly" LatLon points.
|
|
UPSError UPS parse or other error. |
|
UTMError UTM parse or other error. |
|
UTMUPSError UTM/UPS parse, validate or other error. |
|
Ups Universal Polar Stereographic (UPS) coordinate. |
|
Utm Universal Transverse Mercator (UTM) coordinate. |
|
Wm Web Mercator (WM) coordinate. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
value |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
bool |
|
||
|
|||
bool |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
pygeodesy_abspath =
Fully qualified pygeodesy directory name
(str ).
|
|
version =
Normalized PyGeodesy version (str ).
|
|
Conics = Conics.Be08Lb: Conic(name='Be08Lb', lat0=50.797815, l Registered conics ( enum-like ).
|
|
Datums = Datums.BD72: Datum(name='BD72', ellipsoid=Ellipsoids. Registered datums ( enum-like ).
|
|
EPS = 2.22044604925e-16 System's epsilon ≈2.22e-16 ( float ).
|
|
EPS1 = 1.0 1 - EPS ≈0.9999999999999998 ( float ).
|
|
EPS1_2 = 1.0 1 - EPS_2 ≈0.9999999999999999 ( float ).
|
|
EPS_2 = 1.11022302463e-16 Half system's epsilon ≈1.11e-16 ( float ).
|
|
Ellipsoids = Ellipsoids.Airy1830: Ellipsoid(name='Airy1830', a Registered ellipsoids ( enum-like ).
|
|
F_D =
Format degrees as "deg°" ( str ).
|
|
F_DEG =
Format degrees as "[D]DD" without symbol ( str ).
|
|
F_DM =
Format degrees as "deg°min′" ( str ).
|
|
F_DMS =
Format degrees as "deg°min′sec″" ( str ).
|
|
F_MIN =
Format degrees as "[D]DDMM" without symbols ( str ).
|
|
F_RAD =
Convert degrees to radians and format as "RR" ( str ).
|
|
F_SEC =
Format degrees as "[D]DDMMSS" without symbols ( str ).
|
|
INF = inf Infinity ( float ), see isinf ,
isfinite .
|
|
MANTIS = 53 System's mantissa bits ≈53 ( int ).
|
|
MAX = 1.79769313486e+308 System's float max ≈1.798e+308 ( float ).
|
|
MIN = 2.22507385851e-308 System's float min ≈2.225e-308 ( float ).
|
|
NAN = nan Not-A-Number ( float ), see isnan .
|
|
NEG0 = -0.0 Negative 0.0 ( float ), see isneg0 .
|
|
OK =
Unique OK object ( str ).
|
|
PI = 3.14159265359 Constant math.pi ( float ).
|
|
PI2 = 6.28318530718 Two PI, math.pi * 2 ( float ).
|
|
PI_2 = 1.57079632679 Half PI, math.pi / 2 ( float ).
|
|
PI_4 = 0.785398163397 Quarter PI, PI / 4 ( float ).
|
|
R_FM = 6371000.0 Former FAI Sphere earth radius ( meter ).
|
|
R_KM = 6371.00877142 Mean (spherical) earth radius ( km , kilometer).
|
|
R_M = 6371008.77141 Mean (spherical) earth radius ( meter ).
|
|
R_MA = 6378137.0 Major (equatorial) earth radius ( meter ) WGS84,
EPSG:3785.
|
|
R_MB = 6356752.0 Minor (polar) earth radius ( meter ) WGS84, EPSG:3785.
|
|
R_NM = 3440.06953447 Mean (spherical) earth radius ( NM , nautical miles).
|
|
R_SM = 3958.75339537 Mean (spherical) earth radius ( SM , statute miles).
|
|
R_VM = 6366707.01949 Aviation/Navigation earth radius ( meter ).
|
|
RefFrames = RefFrames.ETRF2000: RefFrame(name='ETRF2000', epoc Registered reference frames ( enum-like ).
|
|
S_DEG =
Degrees symbol "°" ( str ).
|
|
S_MIN =
Minutes symbol "′" ( str ).
|
|
S_RAD =
Radians symbol "" ( str ).
|
|
S_SEC =
Seconds symbol "″" ( str ).
|
|
S_SEP =
Separator between deg°, min′ and sec″ "" ( str ).
|
|
Transforms = Transforms.BD72: Transform(name='BD72', tx=106.86 Registered transforms ( enum-like ).
|
|
isLazy = None hash(x) |
Function Details |
Get/set raising of vectorial cross product errors.
|
Class-like function to create a UTM/UPS coordinate.
|
Make a valid name of alphanumeric and OKd characters.
Note: Leading and trailing whitespace characters are removed and intermediate whitespace characters are coalesced and substituted. |
Return the antipode, the point diametrically opposite to a given point.
See Also: Geosphere. |
Approximate the area of a polygon.
Note: This area approximation has limited accuracy and is ill-suited for regions exceeding several hundred Km or Miles or with near-polar latitudes. See Also: sphericalNvector.areaOf, sphericalTrigonometry.areaOf and ellipsoidalKarney.areaOf. |
Compute the initial or final bearing (forward or reverse azimuth) between a (spherical) start and end point.
|
Convert bearing to a string.
JS name: toBrng. |
Compute the initial or final bearing (forward or reverse azimuth) between a (spherical) start and end point.
|
DEPRECATED, use function boundsOf.
|
Determine the lower-left SW and upper-right NE corners of a path or polygon.
Example: >>> b = LatLon(45,1), LatLon(45,2), LatLon(46,2), LatLon(46,1) >>> boundsOf(b) # False >>> 45.0, 1.0, 46.0, 2.0 |
Compute the cubic root x**(1/3).
|
Compute the cubic root squared x**(2/3).
|
Determine the centroid of a polygon.
See Also: Centroid and Calculating The Area And Centroid Of A Polygon. |
Return the instance' class name optionally prefixed with the module name.
|
Get/set the default naming for
|
Clip a path against a rectangular clip box using the Cohen-Sutherland algorithm.
|
Clip a lat- or longitude to the given range.
|
Clip a polygon against a clip region or box using the Sutherland-Hodgman algorithm.
|
Clip a polygon against a clip region or box using the Sutherland-Hodgman algorithm.
|
Clip a string to the given length limit.
|
Return the angle from North for the direction vector (lon2 - lon1, lat2 - lat1) between two points. Suitable only for short, non-near-polar vectors up to a few hundred Km or Miles. Use function bearing for longer vectors.
Note: Courtesy Martin Schultz. See Also: Local, flat earth approximation. |
Convert bearing to a string suffixed with compass point.
|
Convert bearing to a compass point.
See Also: Dms.compassPoint and Compass rose. Example: >>> p = compassPoint(24, 1) # 'N' >>> p = compassPoint(24, 2) # 'NE' >>> p = compassPoint(24, 3) # 'NNE' >>> p = compassPoint(24) # 'NNE' >>> p = compassPoint(11, 4) # 'NbE' >>> p = compassPoint(30, 4) # 'NEbN' >>> p = compassPoint(11.249) # 'N' >>> p = compassPoint(11.25) # 'NNE' >>> p = compassPoint(-11.25) # 'N' >>> p = compassPoint(348.749) # 'NNW' |
Return the reference frame
Note:
Any |
DEPRECATED, use function epsg.decode2.
|
Convert degrees to a string in degrees, minutes or seconds.
|
Convert radians to degrees and wrap [-180..+180].
|
Convert angle to distance along the equator or along a parallel at an other latitude.
|
Convert radians to degrees and wrap [0..+360).
|
Convert radians to degrees and wrap [-270..+90].
|
Generate geoid egm*.pgm height tests from GeoidHeights.dat Test data for Geoids.
Note:
Function egmGeoidHeights is used to test the geoids GeoidKarney and GeoidPGM, see PyGeodesy module
|
Get the geoid elevation at an
Note:
The returned See Also: USGS National Map, the FAQ, geoid.py, module geoids, classes GeoidG2012B, GeoidKarney and GeoidPGM. |
Return easting, northing string representations.
|
DEPRECATED, use function epsg.encode.
|
Compute the distance between two points using the Equirectangular Approximation / Projection.
See Also:
Function equirectangular_ for more details, the available
|
DEPRECATED, use function
|
Compute the distance between two points using the Equirectangular Approximation / Projection. This approximation is valid for short distance of several hundred Km
or Miles, see the
See Also:
Local, flat earth approximation, functions equirectangular, euclidean, haversine and vincentys and methods Ellipsoid.distance2,
|
Approximate the
See Also:
Distance between two (spherical) points,
functions equirectangular, haversine and vincentys and methods Ellipsoid.distance2,
|
Approximate the angular
See Also: Functions euclidean, equirectangular_, haversine_ and vincentys_. |
Convert floats to string, optionally with trailing zero decimals stripped.
|
Strip trailing zero decimals from a float string.
|
Convert a false east-/northing to non-negative float.
|
Return the weighted average of two values.
|
Return the precision dot product sum(a[i] * b[i] for i=0..len(a)).
See Also: Class Fdot. |
Return the precision dot product start + sum(a[i] * b[i] * c[i] for i=0..len(a)).
|
Evaluate the polynomial sum(cs[i] * x**i for i=0..len(cs)) using the Horner form.
See Also: Function fpolynomial and class Fhorner. |
Interpolate using using Inverse Distance Weighting (IDW).
Note:
Using |
Compute the accurate mean sum(xs[i] for i=0..len(xs)) / len(xs).
|
Evaluate the polynomial sum(cs[i] * x**i for i=0..len(cs)).
See Also: Function fhorner and class Fpolynomial. |
Return a series of powers [x**i for i=1..n].
|
Iterable product, like
See Also: NumPy.prod. |
Generate a range of
See Also: NumPy.prod. |
Apply a function of two arguments cumulatively to the items of a sequence, from left to right, so as to reduce the sequence to a single value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). If initial is present, it is placed before the items of the sequence in the calculation, and serves as a default when the sequence is empty.
|
Return an accurate floating point sum of values in the iterable. Assumes IEEE-754 floating point arithmetic. |
Precision summation of the positional argument vulues.
|
Convert International or US Survey feet to meter.
|
Get the
Note:
The returned See Also: NOAA National Geodetic Survey, Geoid, USGS10mElev.py, module geoids, classes GeoidG2012B, GeoidKarney and GeoidPGM. |
Split a string in 2 halfs.
|
Compute the distance between two (spherical) points using the Haversine formula.
See Also:
Distance between two (spherical) points,
functions equirectangular, euclidean and vincentys and methods Ellipsoid.distance2,
Note: See note under vincentys_. |
Compute the angular distance between two (spherical) points using the Haversine formula.
See Also: Functions haversine, equirectangular_, euclidean_ and vincentys_. Note: See note under vincentys_. |
Determine the height above the (spherical) earth after traveling along a straight line at a given tilt.
|
Determine the distance to the horizon from a given altitude above the (spherical) earth.
See Also: Distance to horizon. |
Compute the norm sqrt(1 + x**2).
|
Compute the norm sqrt(sum(xs[i]**2)) for i=0..len(xs).
See Also:
Similar to Python 3.8+ math.hypot, but handling of exceptions,
Note: The Python 3.8+ math.dist Euclidian distance between 2 n-dimensional points p1 and p2 can be computed as hypot_(*((c1 - c2) for c1, c2 in zip(p1, p2))), provided p1 and p2 have the same, non-zero length n. |
Return the string representation of an instance.
|
Check for an
|
Check for an
|
Check for an
|
Check whether two points are antipodal, on diametrically opposite sides of the earth.
See Also: Geosphere. |
Determine the direction of a path or polygon.
Example: >>> f = LatLon(45,1), LatLon(45,2), LatLon(46,2), LatLon(46,1) >>> isclockwise(f) # False >>> isclockwise(reversed(f)) # True |
Determine whether a polygon is convex.
Example: >>> t = LatLon(45,1), LatLon(46,1), LatLon(46,2) >>> isconvex(t) # True >>> f = LatLon(45,1), LatLon(46,2), LatLon(45,2), LatLon(46,1) >>> isconvex(f) # False |
Determine whether a polygon is convex and clockwise.
Example: >>> t = LatLon(45,1), LatLon(46,1), LatLon(46,2) >>> isconvex_(t) # +1 >>> f = LatLon(45,1), LatLon(46,2), LatLon(45,2), LatLon(46,1) >>> isconvex_(f) # 0 |
Determine whether a point is enclosed by a polygon.
|
Check for
|
Check for integer type or integer value.
|
Check for NEG0, negative 0.0.
|
Check whether a polygon encloses a pole.
|
Check for scalar types.
|
Check for sequence types.
Note:
Excluding |
Check whether a class is a subclass of a super class.
|
Iterate over Numpy2 wrappers or other sequences exceeding the threshold.
|
Get or set the iterNumpy2 threshold.
|
Convert latitude to a string suffixed with N or S.
JS name: toLat. |
Make built-in function
|
Get/set the raising of limit errors.
|
Convert longitude to a string suffixed with E or W.
JS name: toLon. |
Convert meter to nautical miles (NM).
|
Convert meter to statute miles (SM).
|
Convert distance to angle along equator.
|
Convert meter to International or US Survey feet
(
|
Convert meter to kilo meter (km).
|
Apply each argument to a single-argument function and return a tuple of results.
|
Apply arguments to a function and return a tuple of results. Unlike Python 2's built-in
|
Get the name of an instance.
|
DEPRECATED, use function nearestOn5.
|
DEPRECATED, use function nearestOn5.
|
Locate the point on a path or polygon closest to an other point. If the given point is within the extent of a polygon edge, the closest point is on that edge, otherwise the closest point is the nearest of that edge's end points. Distances are approximated by function equirectangular_, subject to the supplied
See Also:
Function degrees2m to convert |
Normalize all degree ˚, minute ' and second " symbols in a string to the default symbols °, ′ and ″.
|
Parse a string representing lat-, longitude and height point. The lat- and longitude value must be separated by a separator character. If height is present it must follow, separated by another separator. The lat- and longitude values may be swapped, provided at least one ends with the proper compass point.
|
Parse a string representing deg°min′sec″ to degrees. This is very flexible on formats, allowing signed decimal degrees, degrees and minutes or degrees minutes and seconds optionally suffixed by compass direction NSEW. A variety of symbols, separators and suffixes are accepted, for example 3° 37′ 09″W. Minutes and seconds may be omitted.
See Also: Function parse3llh to parse a string with lat-, longitude and height values. |
Parse lat- and longitude representions.
|
Parse a string representing a UTM coordinate, consisting of
Example: >>> u = parseETM5('31 N 448251 5411932') >>> u.toStr2() # [Z:31, H:N, E:448251, N:5411932] >>> u = parseETM5('31 N 448251.8 5411932.7') >>> u.toStr() # 31 N 448252 5411933 |
Parse a string representing a MGRS grid reference, consisting of zoneBand, grid, easting and northing.
Example: >>> m = parseMGRS('31U DQ 48251 11932') >>> str(m) # 31U DQ 48251 11932 >>> m = parseMGRS('31UDQ4825111932') >>> repr(m) # [Z:31U, G:DQ, E:48251, N:11932] |
Parse an OSGR coordinate string to an Osgr instance. Accepts standard OS Grid References like 'SU 387 148', with or without whitespace separators, from 2- up to 10-digit references (1 m × 1 m square), or fully numeric, comma-separated references in metres, for example '438700,114800'.
Example: >>> g = parseOSGR('TG 51409 13177') >>> str(g) # TG 51409 13177 >>> g = parseOSGR('TG5140913177') >>> str(g) # TG 51409 13177 >>> g = parseOSGR('TG51409 13177') >>> str(g) # TG 51409 13177 >>> g = parseOSGR('651409,313177') >>> str(g) # TG 51409 13177 >>> g.toStr(prec=0) # 651409,313177 |
Parse a string representing a UPS coordinate, consisting of
|
DEPRECATED, use function parseUTM5.
|
Parse a string representing a UTM coordinate, consisting of
Example: >>> u = parseUTM5('31 N 448251 5411932') >>> u.toStr2() # [Z:31, H:N, E:448251, N:5411932] >>> u = parseUTM5('31 N 448251.8 5411932.7') >>> u.toStr() # 31 N 448252 5411933 |
Parse a string representing a UTM or UPS coordinate, consisting of
|
Parse a string representing a WM coordinate, consisting of easting, northing and an optional radius.
Example: >>> u = parseWM('448251 5411932') >>> u.toStr2() # [E:448251, N:5411932] |
Approximate the perimeter of a path or polygon.
Note: This perimeter is based on the equirectangular_ distance approximation and is ill-suited for regions exceeding several hundred Km or Miles or with near-polar latitudes. See Also: sphericalTrigonometry.perimeterOf and ellipsoidalKarney.perimeterOf. |
Check a polygon represented by points.
|
Set the default precison for a given F_ form.
|
Decorator for
Note:
Like standard Python |
Convert and wrap degrees to radians [-PI..+PI].
|
Convert and wrap degrees to radians [0..+2PI).
|
Convert and wrap degrees to radians [-3PI/2..+PI/2].
|
Gert/set raising of range errors.
Note: Out-of-range lat- and longitude values are always clipped to the nearest range limit. |
Validate a scalar.
|
Basic simplification of a path of Eliminates any points closer together than the given distance tolerance.
|
Ramer-Douglas-Peucker (RDP) simplification of a path of
Eliminates any points too close together or closer to an edge than the given distance tolerance. This RDP method exhaustively searches for the point with the largest distance, resulting in worst-case complexity O(n**2) where n is the number of points.
|
Modified Ramer-Douglas-Peucker (RDPm) simplification of a path of
Eliminates any points too close together or closer to an edge than the given distance tolerance. This RDP method stops at the first point farther than the given distance tolerance, significantly reducing the run time (but producing results different from the original RDP method).
|
Reumann-Witkam (RW) simplification of a path of Eliminates any points too close together or within the given pipe tolerance along an edge.
|
Visvalingam-Whyatt (VW) simplification of a path of
Eliminates any points too close together or with a triangular area not exceeding the given area tolerance (squared). This VW method exhaustively searches for the single point with the smallest triangular area, resulting in worst-case complexity O(n**2) where n is the number of points.
|
Modified Visvalingam-Whyatt (VWm) simplification of a path of
Eliminates any points too close together or with a triangular area not exceeding the given area tolerance (squared). This VW method removes all points with a triangular area below the tolerance each iteration, significantly reducing the run time (but producing results different from the original VW method).
|
Return the
See Also: GeographicLib function sincosd and C++ sincosd. |
Return the
See Also: GeographicLib function sincosd and C++ sincosd. |
Split an iterable into
Note:
Each generated slice is a Example: >>> from pygeodesy import splice >>> a, b = splice(range(10)) >>> a, b ((0, 2, 4, 6, 8), (1, 3, 5, 7, 9)) >>> a, b, c = splice(range(10), n=3) >>> a, b, c ((0, 3, 6, 9), (1, 4, 7], [2, 5, 8)) >>> a, b, c = splice(range(10), n=3, fill=-1) >>> a, b, c ((0, 3, 6, 9), (1, 4, 7, -1), (2, 5, 8, -1)) >>> list(splice(range(12), n=5)) [(0, 5, 10), (1, 6, 11), (2, 7), (3, 8), (4, 9)] >>> splice(range(9), n=1) <generator object splice at 0x0...> |
Compute the square root cubed sqrt(x)**3 or sqrt(x**3).
|
Compute the tangent of half angle, 90 degrees rotated.
|
Compute the tangent of half angle.
|
Convert an (ellipsoidal) geodetic point to a Cassini-Soldner location.
|
Convert signed degrees to string, without suffix.
|
Convert a lat-/longitude point to an ETM coordinate.
|
Convert an (ellipsoidal) geodetic point to a Lambert location.
|
Convert a UTM coordinate to an MGRS grid reference.
Example: >>> u = Utm(31, 'N', 448251, 5411932) >>> m = u.toMgrs() # 31U DQ 48251 11932 |
Convert a lat-/longitude point to an OSGR coordinate.
Example: >>> p = LatLon(52.65798, 1.71605) >>> r = toOsgr(p) # TG 51409 13177 >>> # for conversion of (historical) OSGB36 lat-/longitude: >>> r = toOsgr(52.65757, 1.71791, datum=Datums.OSGB36) |
Convert a lat-/longitude point to a UPS coordinate.
See Also: Karney's C++ class UPS. |
DEPRECATED, use function toUtm8.
|
Convert a lat-/longitude point to a UTM coordinate.
Note: Implements Karney’s method, using 8-th order Krüger series, giving results accurate to 5 nm (or better) for distances up to 3900 km from the central meridian. Example: >>> p = LatLon(48.8582, 2.2945) # 31 N 448251.8 5411932.7 >>> u = toUtm(p) # 31 N 448252 5411933 >>> p = LatLon(13.4125, 103.8667) # 48 N 377302.4 1483034.8 >>> u = toUtm(p) # 48 N 377302 1483035 |
Convert a lat-/longitude point to a UTM or UPS coordinate.
|
Convert a lat-/longitude point to a WM coordinate.
Example: >>> p = LatLon(48.8582, 2.2945) # 448251.8 5411932.7 >>> w = toWm(p) # 448252 5411933 >>> p = LatLon(13.4125, 103.8667) # 377302.4 1483034.8 >>> w = toWm(p) # 377302 1483035 |
Return the string representation of an invokation.
|
Unroll longitudinal delta and wrap longitude in degrees.
See Also:
Capability |
Unroll longitudinal delta and wrap longitude in radians.
See Also:
Capability |
Return the UTM/UPS zone number, (polar) Band letter, pole and clipped lat- and longitude for a given location.
|
DEPRECATED, use function utmZoneBand5.
|
Return the UTM zone number, Band letter, hemisphere and (clipped) lat- and longitude for a given location.
|
Check a UTM or UPS coordinate.
See Also: Function utmupsValidateOK. |
Check a UTM or UPS coordinate.
See Also: Function utmupsValidate. |
Return the UTM/UPS zone number, Band letter, hemisphere/pole and clipped lat- and longitude for a given location.
See Also: Functions utmZoneBand5 and upsZoneBand5. |
Compute the distance between two (spherical) points using Vincenty's spherical formula.
See Also:
Functions equirectangular, euclidean and haversine and methods Ellipsoid.distance2,
Note: See note under vincentys_. |
Compute the angular distance between two (spherical) points using Vincenty's spherical formula.
See Also: Functions vincentys, equirectangular_, euclidean_ and haversine_. Note: Functions vincentys_ and haversine_ produce equivalent results, but vincentys_ is suitable for antipodal points and slightly more expensive than haversine_ (3 cos, 3 sin, 1 hypot, 1 atan2, 7 mul, 2 add versus 2 cos, 2 sin, 2 sqrt, 1 atan2, 5 mul, 1 add). |
Wrap degrees to [-180..+180].
|
Wrap degrees to [0..+360).
|
Wrap degrees to [-270..+90].
|
Wrap radians to [-PI..+PI].
|
Wrap radians to [0..+2PI).
|
Wrap radians to [-3PI/2..+PI/2].
|
Variables Details |
pygeodesy_abspathFully qualifiedpygeodesy directory name (str ).
|
ConicsRegistered conics (enum-like ).
|
DatumsRegistered datums (enum-like ).
|
EllipsoidsRegistered ellipsoids (enum-like ).
|
RefFramesRegistered reference frames (enum-like ).
|
TransformsRegistered transforms (enum-like ).
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 2 11:49:45 2019 | http://epydoc.sourceforge.net |