A pure Python implementation of geodesy tools for various ellipsoidal
and spherical earth models using precision trigonometric and vector-based
methods for geodetic (lat-/longitude) and geocentric cartesian (x/y/z)
coordinates.
The tests have been run with 64-bit Python 2.6.9 (and numpy 1.6.2),
2.7.13 (and numpy 1.13.1), 3.5.3 and 3.6.2, but only on MacOSX 10.10
Yosemite, MacOSX 10.11 El Capitan or macOS 10.12.6 Sierra, with 64-bit
Intel-Python 3.5.3 (and numpy 1.11.3) on macOS 10.12.6 Sierra and with
Pythonista 3.1 using 64-bit Python 2.7.12 and 3.5.1 (both with numpy
1.8.0) on iOS 10.3.3.
Some function and method names differ from the JavaScript version. In
such cases documentation tag JS name: shows the original
JavaScript name.
|
bearingDMS(bearing,
form=' d ' ,
prec=None,
sep='
' )
Convert bearing to a string. |
|
|
|
bounds(points,
radius=None,
wrap=True,
LatLon=None)
Determine the lower-left and upper-right corners of a polygon defined
by a list, sequence, set or tuple of LatLon points. |
|
|
|
cbrt(x)
Compute the cubic root x**(1/3). |
|
|
|
cbrt2(x)
Compute the cubic root squared x**(2/3). |
|
|
|
classname(obj)
Build module.class name of this object. |
|
|
|
compassDMS(bearing,
form=' d ' ,
prec=None,
sep='
' )
Convert bearing to a string suffixed with compass point. |
|
|
|
compassPoint(bearing,
prec=3)
Convert bearing to a compass point. |
|
|
|
crosserrors(raiser=None)
Get/set cross product exceptions. |
|
|
|
degrees(x)
Convert angle x from radians to degrees. |
|
|
|
degrees180(rad)
Convert and wrap radians to degrees -180..+180. |
|
|
|
degrees360(rad)
Convert and wrap radians to degrees 0..+360. |
|
|
|
degrees90(rad)
Convert and wrap radians to degrees -270..+90. |
|
|
|
fStr(floats,
prec=6,
sep=' , ' ,
fmt=' %.*f ' ,
ints=False)
Convert floats to string, optionally with trailing zero decimals
stripped. |
|
|
|
fStrzs(fstr)
Strip trailing zero decimals from a float string. |
|
|
|
false2f(value,
name=' value ' ,
false=True)
Convert a false east-/northing to non-negative float. |
|
|
|
favg(v1,
v2,
f=0.5)
Return the weighted average of two values. |
|
|
|
fdot(a,
*b)
Return the precision dot product sum(a[i] * b[i] for
i in range(len(a))). |
|
|
|
fdot3(a,
b,
c,
start=0)
Return the precision dot product sum(a[i] * b[i] *
c[i] for i in range(len(a))) + start. |
|
|
|
fmean(floats)
Compute the mean of float values. |
|
|
|
fpolynomial(x,
*cs)
Evaluate the polynomial sum(cs[i] * x**i),
i=0..len(cs)). |
|
|
|
fsum(iterable)
Return an accurate floating point sum of values in the iterable. |
|
|
|
ft2m(feet)
Convert feet to meter (m). |
|
|
|
halfs(str2)
Split a string in 2 halfs. |
|
|
|
hsin(rad)
Compute the Haversine value of an angle. |
|
|
|
hsin3(a2,
a1,
b21)
Compute the angular distance using the Haversine formula. |
|
|
|
hypot(x,
y)
Return the Euclidean distance, sqrt(x*x + y*y). |
|
|
|
hypot1(x)
Compute the norm sqrt(1 + x**2). |
|
|
|
hypot3(x,
y,
z)
Compute the norm sqrt(x**2 + y**2 + z**2). |
|
|
|
inStr(inst,
*args,
**kwds)
Return the string representation of an instance. |
|
|
|
|
|
isclockwise(points,
radius=None,
wrap=True)
Determine the direction of a polygon defined by an array, list,
sequence, set or tuple of LatLon points. |
|
|
|
isconvex(points,
radius=None,
wrap=True)
Determine whether a polygon defined by an array, list, sequence, set
or tuple of LatLon points is convex. |
|
|
|
isint(obj,
both=False)
Check for integer type or integer value. |
|
|
|
|
|
issequence(obj,
*excluded)
Check for sequence types. |
|
|
|
iterNumpy2(obj)
Iterate over Numpy2 wrappers or other sequences exceeding the
threshold. |
|
|
|
|
|
latDMS(deg,
form=' dms ' ,
prec=2,
sep='
' )
Convert latitude to a string suffixed with N or S. |
|
|
|
len2(seq)
Make built-in function len work for
generators, iterators, etc. |
|
|
|
lonDMS(deg,
form=' dms ' ,
prec=2,
sep='
' )
Convert longitude to a string suffixed with E or W. |
|
|
|
m2NM(meter)
Convert meter to nautical miles (NM). |
|
|
|
m2SM(meter)
Convert meter to statute miles (SM). |
|
|
|
m2ft(meter)
Convert meter to feet (ft). |
|
|
|
m2km(meter)
Convert meter to kilo meter (km). |
|
|
|
map1(func,
*args)
Apply each argument to a single-argument function and return a tuple
of results. |
|
|
|
map2(func,
*args)
Apply arguments to a function and return a tuple of results. |
|
|
|
normDMS(strDMS,
norm='
' )
Normalize all degree ˚, minute ' and second " symbols in a
string to the default symbols °, ′ and ″. |
|
|
|
parse3llh(strll,
height=0,
sep=' , ' )
Parse a string representing lat-, longitude and height point. |
|
|
|
parseDMS(strDMS,
suffix=' NSEW ' ,
sep='
' )
Parse a string representing deg°min′sec″ to degrees. |
|
|
|
parseMGRS(strMGRS,
datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran... )
Parse a string representing a MGRS grid reference, consisting of
zoneBand, grid, easting and northing. |
|
|
|
parseOSGR(strOSGR)
Parse an OSGR coordinate string to an Osgr instance. |
|
|
|
parseUTM(strUTM,
datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran... )
Parse a string representing a UTM coordinate, consisting of zone,
hemisphere, easting and northing. |
|
|
|
polygon(points,
closed=True,
base=None)
Check a polygon given as an array, list, sequence, set or tuple of
points. |
|
|
|
precision(form,
prec=None)
Set the default precison for a given F_ form. |
|
|
|
radians(x)
Convert angle x from degrees to radians. |
|
|
|
radiansPI(deg)
Convert and wrap degrees to radians -PI..+PI. |
|
|
|
radiansPI2(deg)
Convert and wrap degrees to radians 0..+2PI. |
|
|
|
radiansPI_2(deg)
Convert and wrap degrees to radians -3PI/2..+PI/2. |
|
|
|
scalar(value,
low=2.22044604925e-16,
high=1.0)
Validate a scalar. |
|
|
|
simplify1(points,
distance,
radius=6371008.77141,
adjust=True,
indices=False)
Basic simplification of a path of LatLon points. |
|
|
|
simplify2(points,
pipe,
radius=6371008.77141,
adjust=True,
shortest=False,
indices=False)
Reumann-Witkam simplification of a path of LatLon points. |
|
|
|
simplifyRDP(points,
distance,
radius=6371008.77141,
adjust=True,
shortest=False,
indices=False)
Ramer-Douglas-Peucker (RDP) simplification of a path of LatLon
points. |
|
|
|
simplifyRDPm(points,
distance,
radius=6371008.77141,
adjust=True,
shortest=False,
indices=False)
Modified Ramer-Douglas-Peucker (RDP) simplification of a path of
LatLon points. |
|
|
|
simplifyRW(points,
pipe,
radius=6371008.77141,
adjust=True,
shortest=False,
indices=False)
Reumann-Witkam simplification of a path of LatLon points. |
|
|
|
simplifyVW(points,
area,
radius=6371008.77141,
adjust=True,
attr=None,
indices=False)
Visvalingam-Whyatt (VW) simplification of a path of LatLon
points. |
|
|
|
simplifyVWm(points,
area,
radius=6371008.77141,
adjust=True,
attr=None,
indices=False)
Modified Visvalingam-Whyatt (VW) simplification of a path of
LatLon points. |
|
|
|
tanPI_2_2(rad)
Compute the tangent of half angle, 90 degrees rotated. |
|
|
|
tan_2(rad)
Compute the tangent of half angle. |
|
|
|
toDMS(deg,
form=' dms ' ,
prec=2,
sep='
' ,
ddd=2,
neg=' - ' ,
pos='
' )
Convert signed degrees to string, without suffix. |
|
|
|
toLcc(latlon,
conic=Conic(name='WRF_Lb', lat0=40.0, lon0=-97.0, par1=33.0, par2=45... ,
height=None,
Lcc=<class 'pygeodesy.lcc.Lcc'>)
Convert an (ellipsoidal) geodetic point to a Lambert location. |
|
|
|
toMgrs(utm,
Mgrs=<class 'pygeodesy.mgrs.Mgrs'>)
Convert a UTM coordinate to an MGRS grid reference. |
|
|
|
toOsgr(latlon,
lon=None,
datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran... ,
Osgr=<class 'pygeodesy.osgr.Osgr'>)
Convert a lat-/longitude point to an OSGR coordinate. |
|
|
|
toUtm(latlon,
lon=None,
datum=None,
Utm=<class 'pygeodesy.utm.Utm'>)
Convert a lat-/longitude point to a UTM coordinate. |
|
|
|
wrap180(deg)
Wrap degrees to -180..+180. |
|
|
|
wrap360(deg)
Wrap degrees to 0..+360. |
|
|
|
wrap90(deg)
Wrap degrees to -270..+90. |
|
|
|
wrapPI(rad)
Wrap radians to -PI..+PI. |
|
|
|
wrapPI2(rad)
Wrap radians to 0..+2PI. |
|
|
|
wrapPI_2(rad)
Wrap radians to -3PI/2..+PI/2. |
|
|
|
version = ' 17.9.14 '
Normalized PyGeodesy version (string).
|
|
Conics = Conics.Be08Lb: Conic(name='Be08Lb', lat0=50.797815, l...
Registered conics (enum).
|
|
Datums = Datums.BD72: Datum(name='BD72', ellipsoid=Ellipsoids....
Registered datums (enum).
|
|
EPS = 2.22044604925e-16
System's epsilon (float)
|
|
EPS1 = 1.0
1 - EPS (float), about 0.9999999999999998
|
|
EPS2 = 1.49011611938e-08
sqrt(EPS) (float)
|
|
Ellipsoids = Ellipsoids.Airy1830: Ellipsoid(name='Airy1830', a...
Registered ellipsoids (enum).
|
|
F_D = ' d '
Format degrees as deg° (string).
|
|
F_DEG = ' deg '
Format degrees as [D]DD without symbol (string).
|
|
F_DM = ' dm '
Format degrees as deg°min′ (string).
|
|
F_DMS = ' dms '
Format degrees as deg°min′sec″ (string).
|
|
F_MIN = ' min '
Format degrees as [D]DDMM without symbols (string).
|
|
F_RAD = ' rad '
Convert degrees to radians and format as RR (string).
|
|
F_SEC = ' sec '
Format degrees as [D]DDMMSS without symbols (string).
|
|
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)
|
|
R_KM = 6371.00877142
Mean, spherical earth radius (kilo meter).
|
|
R_M = 6371008.77141
Mean, spherical earth radius (meter).
|
|
R_NM = 3440.06953447
Mean, spherical earth radius (nautical miles).
|
|
R_SM = 3958.75339537
Mean, spherical earth radius (statute miles).
|
|
S_DEG = ' \xc2\xb0 '
Degrees symbol ° (string).
|
|
S_MIN = ' \xe2\x80\xb2 '
Minutes symbol ′ (string).
|
|
S_RAD = '
'
Radians symbol (string).
|
|
S_SEC = ' \xe2\x80\xb3 '
Seconds symbol ″ (string).
|
|
S_SEP = '
'
Separator between deg°, min′ and sec″ (string).
|
|
Transforms = Transforms.BD72: Transform(name='BD72', tx=106.86...
Registered transforms (enum).
|