A pure Python implementation of geodesy tools for various ellipsoidal
and spherical earth models using 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, 2.7.13, 3.5.3 and
3.6.1, but only on MacOSX 10.10 Yosemite, MacOSX 10.11 El Capitan or
macOS 10.12.2, 10.12.3, 10.12.4 or 10.12.5 Sierra.
Some function and method names differ from the JavaScript version. In
such cases documentation tag JS name: shows the original
JavaScript name.
|
isclockwise(points)
Determine direction of a polygon defined by a list, sequence, set or
tuple of LatLon points. |
|
|
|
bearingDMS(bearing,
form=' d ' ,
prec=None)
Converts bearing to string. |
|
|
|
cbrt(x)
Computes the cubic root x**(1/3). |
|
|
|
cbrt2(x)
Computes the cubic root squared x**(2/3). |
|
|
|
compassDMS(bearing,
form=' d ' ,
prec=None)
Converts bearing to string suffixed with compass point. |
|
|
|
compassPoint(bearing,
prec=3)
Converts bearing to compass point. |
|
|
|
degrees(x)
Convert angle x from radians to degrees. |
|
|
|
degrees180(rad)
Converts and wraps radians to degrees -180..+180. |
|
|
|
degrees360(rad)
Converts and wraps radians to degrees 0..+360. |
|
|
|
degrees90(rad)
Converts and wraps radians to degrees -270..+90. |
|
|
|
fStr(floats,
prec=6,
sep=' , ' ,
fmt=' %.*f ' ,
ints=False)
Converts floats to string, optionally with trailing zero decimals
stripped. |
|
|
|
fStrzs(fstr)
Strips trailing zero decimals from a float string. |
|
|
|
false2f(value,
name=' value ' ,
false=True)
Converts false east-/northing to non-negative float. |
|
|
|
favg(v1,
v2,
f=0.5)
Returns the weighted average of two values. |
|
|
|
fdot(a,
*b)
Returns the precision dot product sum(a[i] * b[i] for
i in range(len(a))). |
|
|
|
fdot3(a,
b,
c,
start=0)
Returns the precision dot product sum(a[i] * b[i] *
c[i] for i in range(len(a))) + start. |
|
|
|
fsum(iterable)
Return an accurate floating point sum of values in the iterable. |
|
|
|
ft2m(feet)
Converts feet to meter (m). |
|
|
|
halfs(str2)
Splits a string in 2 halfs. |
|
|
|
hsin(rad)
Computes the Haversine value of an angle. |
|
|
|
hsin3(a2,
a1,
b21)
Computes the angular distance using the Haversine formula. |
|
|
|
hypot(x,
y)
Return the Euclidean distance, sqrt(x*x + y*y). |
|
|
|
hypot1(x)
Computes the norm sqrt(1 + x**2). |
|
|
|
hypot3(x,
y,
z)
Computes the norm sqrt(x**2 + y**2 + z**2). |
|
|
|
isint(obj,
both=False)
Checks for integer types and value. |
|
|
|
|
|
latDMS(deg,
form=' dms ' ,
prec=2)
Converts latitude to string suffixed with N or S. |
|
|
|
len2(xtor)
Makes built-in len () function work for
generators, iterators, etc. |
|
|
|
lonDMS(deg,
form=' dms ' ,
prec=2)
Converts longitude to string suffixed with E or W. |
|
|
|
m2NM(meter)
Converts meter to nautical miles (NM). |
|
|
|
m2SM(meter)
Converts meter to statute miles (SM). |
|
|
|
m2ft(meter)
Converts meter to feet (ft). |
|
|
|
m2km(meter)
Converts meter to kilo meter (km). |
|
|
|
map1(func,
*args)
Applies each argument to a single-argument function and returns a
tuple of results. |
|
|
|
map2(func,
*args)
Applies arguments to a function and returns a tuple of results. |
|
|
|
normDMS(strDMS,
norm='
' )
Normalizes all degrees ˚, minutes ' and seconds " symbols in a
string to the defaults °, ′ and ″. |
|
|
|
parse3llh(strll,
height=0,
sep=' , ' )
Parses a string representing lat-, longitude and height point. |
|
|
|
parseDMS(strDMS,
suffix=' NSEW ' ,
sep='
' )
Parses a string representing deg°min′sec″ to degrees. |
|
|
|
parseMGRS(strMGRS,
datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran... )
Parses a string representing a MGRS grid reference, consisting of
zoneBand, grid, easting and northing. |
|
|
|
parseOSGR(strOSGR)
Parses an OSGR coordinate string to an Osgr instance. |
|
|
|
parseUTM(strUTM,
datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran... )
Parses a string representing a UTM coordinate, consisting of zone,
hemisphere, easting and northing. |
|
|
|
precision(form,
prec=None)
Sets the default precison for a given F_ form. |
|
|
|
radians(x)
Convert angle x from degrees to radians. |
|
|
|
radiansPI(deg)
Converts and wraps degrees to radians -PI..+PI. |
|
|
|
radiansPI2(deg)
Converts and wraps degrees to radians 0..+2PI. |
|
|
|
radiansPI_2(deg)
Converts and wraps degrees to radians -3PI/2..+PI/2. |
|
|
|
simplify1(points,
distance,
radius=6371008.77141,
adjust=True)
Basic simplification of a path of LatLon points. |
|
|
|
simplify2(points,
band2,
radius=6371008.77141,
adjust=True,
shortest=False)
Pipe simplification of a path of LatLon points. |
|
|
|
simplifyRDP(points,
distance,
radius=6371008.77141,
adjust=True,
shortest=False)
Ramer-Douglas-Peucker (RDP) simplification of a path of LatLon
points. |
|
|
|
simplifyRDPm(points,
distance,
radius=6371008.77141,
adjust=True,
shortest=False)
Modified Ramer-Douglas-Peucker (RDP) simplification of a path of
LatLon points. |
|
|
|
simplifyVW(points,
area2,
radius=6371008.77141,
adjust=True,
attr=None)
Visvalingam-Whyatt (VW) simplification of a path of LatLon
points. |
|
|
|
simplifyVWm(points,
area2,
radius=6371008.77141,
adjust=True,
attr=None)
Modified Visvalingam-Whyatt (VW) simplification of a path of
LatLon points. |
|
|
|
tanPI_2_2(rad)
Computes tan of half angle, rotated. |
|
|
|
toDMS(deg,
form=' dms ' ,
prec=2,
ddd=2,
neg=' - ' ,
pos='
' )
Converts 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'>)
Converts an (ellipsoidal) geodetic point to a Lambert location. |
|
|
|
toMgrs(utm,
Mgrs=<class 'pygeodesy.mgrs.Mgrs'>)
Converts 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'>)
Converts lat-/longitude point to na OSGR coordinate. |
|
|
|
toUtm(latlon,
lon=None,
datum=None,
Utm=<class 'pygeodesy.utm.Utm'>)
Converts lat-/longitude point to a UTM coordinate. |
|
|
|
wrap180(deg)
Wraps degrees to -180..+180. |
|
|
|
wrap360(deg)
Wraps degrees to 0..+360. |
|
|
|
wrap90(deg)
Wraps degrees to -270..+90. |
|
|
|
wrapPI(rad)
Wraps radians to -PI..+PI. |
|
|
|
wrapPI2(rad)
Wraps radians to 0..+2PI. |
|
|
|
wrapPI_2(rad)
Wraps radians to -3PI/2..+PI/2. |
|
|
|
version = ' 17.5.30 '
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 without symbol (string).
|
|
F_DM = ' dm '
Format degrees as deg°min′ (string).
|
|
F_DMS = ' dms '
Format degrees as deg°min′sec″ (string).
|
|
F_RAD = ' rad '
Convert degrees to radians and format (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).
|