pygeodesy 24.6.9__py2.py3-none-any.whl → 24.6.24__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/METADATA +2 -2
- PyGeodesy-24.6.24.dist-info/RECORD +117 -0
- pygeodesy/__init__.py +33 -32
- pygeodesy/albers.py +2 -2
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/auxAngle.py +40 -39
- pygeodesy/auxilats/auxDLat.py +3 -2
- pygeodesy/auxilats/auxLat.py +16 -18
- pygeodesy/auxilats/auxily.py +1 -1
- pygeodesy/azimuthal.py +10 -10
- pygeodesy/basics.py +9 -1
- pygeodesy/booleans.py +4 -4
- pygeodesy/cartesianBase.py +11 -14
- pygeodesy/css.py +14 -18
- pygeodesy/datums.py +6 -6
- pygeodesy/deprecated/__init__.py +1 -1
- pygeodesy/deprecated/classes.py +16 -2
- pygeodesy/deprecated/datum.py +3 -3
- pygeodesy/deprecated/functions.py +6 -8
- pygeodesy/dms.py +23 -27
- pygeodesy/ecef.py +4 -4
- pygeodesy/elevations.py +4 -4
- pygeodesy/ellipsoidalBase.py +23 -28
- pygeodesy/ellipsoidalBaseDI.py +19 -23
- pygeodesy/ellipsoidalExact.py +3 -3
- pygeodesy/ellipsoidalGeodSolve.py +15 -23
- pygeodesy/ellipsoidalKarney.py +37 -60
- pygeodesy/ellipsoidalNvector.py +38 -44
- pygeodesy/ellipsoidalVincenty.py +11 -14
- pygeodesy/ellipsoids.py +107 -101
- pygeodesy/errors.py +100 -48
- pygeodesy/etm.py +32 -44
- pygeodesy/formy.py +55 -58
- pygeodesy/frechet.py +18 -20
- pygeodesy/fsums.py +3 -3
- pygeodesy/gars.py +3 -4
- pygeodesy/geodesici.py +909 -0
- pygeodesy/geodesicw.py +11 -13
- pygeodesy/geodesicx/__init__.py +4 -4
- pygeodesy/geodesicx/gx.py +18 -28
- pygeodesy/geodesicx/gxbases.py +20 -8
- pygeodesy/geodesicx/gxline.py +16 -22
- pygeodesy/geodsolve.py +80 -10
- pygeodesy/geohash.py +26 -34
- pygeodesy/geoids.py +28 -37
- pygeodesy/hausdorff.py +17 -18
- pygeodesy/heights.py +2 -2
- pygeodesy/internals.py +6 -0
- pygeodesy/interns.py +2 -2
- pygeodesy/karney.py +20 -4
- pygeodesy/ktm.py +13 -16
- pygeodesy/latlonBase.py +17 -19
- pygeodesy/lazily.py +7 -6
- pygeodesy/lcc.py +28 -31
- pygeodesy/ltp.py +7 -8
- pygeodesy/ltpTuples.py +68 -70
- pygeodesy/mgrs.py +8 -9
- pygeodesy/named.py +19 -10
- pygeodesy/nvectorBase.py +9 -10
- pygeodesy/osgr.py +9 -9
- pygeodesy/points.py +6 -6
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +5 -5
- pygeodesy/rhumb/bases.py +30 -31
- pygeodesy/rhumb/ekx.py +3 -4
- pygeodesy/sphericalBase.py +10 -11
- pygeodesy/sphericalNvector.py +13 -13
- pygeodesy/sphericalTrigonometry.py +86 -97
- pygeodesy/streprs.py +4 -34
- pygeodesy/triaxials.py +48 -43
- pygeodesy/units.py +204 -271
- pygeodesy/unitsBase.py +115 -107
- pygeodesy/ups.py +26 -31
- pygeodesy/utily.py +8 -8
- pygeodesy/utm.py +35 -40
- pygeodesy/utmups.py +43 -46
- pygeodesy/utmupsBase.py +8 -9
- pygeodesy/vector3d.py +26 -27
- pygeodesy/vector3dBase.py +6 -7
- pygeodesy/webmercator.py +19 -21
- pygeodesy/wgrs.py +18 -20
- PyGeodesy-24.6.9.dist-info/RECORD +0 -116
- {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
pygeodesy/ellipsoidalBaseDI.py
CHANGED
|
@@ -7,7 +7,7 @@ class C{LatLonEllipsoidalBaseDI} and functions.
|
|
|
7
7
|
# make sure int/int division yields float quotient, see .basics
|
|
8
8
|
from __future__ import division as _; del _ # PYCHOK semicolon
|
|
9
9
|
|
|
10
|
-
from pygeodesy.basics import isLatLon,
|
|
10
|
+
from pygeodesy.basics import isLatLon, _xsubclassof
|
|
11
11
|
from pygeodesy.constants import EPS, MAX, PI, PI2, PI_4, isnear0, isnear1, \
|
|
12
12
|
_EPSqrt as _TOL, _0_0, _0_5, _1_5, _3_0
|
|
13
13
|
# from pygeodesy.dms import F_DMS # _MODS
|
|
@@ -20,8 +20,7 @@ from pygeodesy.formy import _isequalTo, opposing, _radical2
|
|
|
20
20
|
from pygeodesy.interns import _antipodal_, _concentric_, _ellipsoidal_, \
|
|
21
21
|
_exceed_PI_radians_, _low_, _near_, \
|
|
22
22
|
_SPACE_, _too_
|
|
23
|
-
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
|
|
24
|
-
_dunder_nameof
|
|
23
|
+
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
|
|
25
24
|
from pygeodesy.namedTuples import Bearing2Tuple, Destination2Tuple, \
|
|
26
25
|
Intersection3Tuple, NearestOn2Tuple, \
|
|
27
26
|
NearestOn8Tuple, _LL4Tuple
|
|
@@ -35,7 +34,7 @@ from pygeodesy.utily import m2km, unroll180, _unrollon, _unrollon3, \
|
|
|
35
34
|
from math import degrees, radians
|
|
36
35
|
|
|
37
36
|
__all__ = _ALL_LAZY.ellipsoidalBaseDI
|
|
38
|
-
__version__ = '24.
|
|
37
|
+
__version__ = '24.06.17'
|
|
39
38
|
|
|
40
39
|
_polar__ = 'polar?'
|
|
41
40
|
_B2END = _1_5 # _intersect3 bearing to pseudo-end point factor
|
|
@@ -111,9 +110,8 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
|
|
|
111
110
|
def _Direct(self, distance, bearing, LL, height): # overloaded by I{Vincenty}
|
|
112
111
|
'''(INTERNAL) I{Karney}'s C{Direct} method.
|
|
113
112
|
|
|
114
|
-
@return: A L{Destination2Tuple}C{(destination, final)} or
|
|
115
|
-
|
|
116
|
-
B{C{LL}} is C{None}.
|
|
113
|
+
@return: A L{Destination2Tuple}C{(destination, final)} or a
|
|
114
|
+
L{Destination3Tuple}C{(lat, lon, final)} if C{B{LL} is None}.
|
|
117
115
|
'''
|
|
118
116
|
g = self.geodesic
|
|
119
117
|
r = g.Direct3(self.lat, self.lon, bearing, distance)
|
|
@@ -337,17 +335,17 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
|
|
|
337
335
|
|
|
338
336
|
@arg points: The path or polygon points (C{LatLon}[]).
|
|
339
337
|
@kwarg closed: Optionally, close the polygon (C{bool}).
|
|
340
|
-
@kwarg height: Optional height, overriding the height of this and
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
@return: A L{NearestOn8Tuple}C{(closest, distance, fi, j, start,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
338
|
+
@kwarg height: Optional height, overriding the height of this and all
|
|
339
|
+
other points (C{meter}, conventionally). If C{B{height}
|
|
340
|
+
is None}, each point's height is taken into account to
|
|
341
|
+
compute distances.
|
|
342
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}}
|
|
343
|
+
(C{bool}).
|
|
344
|
+
|
|
345
|
+
@return: A L{NearestOn8Tuple}C{(closest, distance, fi, j, start, end,
|
|
346
|
+
initial, final)} with C{distance} in C{meter}, conventionally
|
|
347
|
+
and with the C{closest}, the C{start} the C{end} point each
|
|
348
|
+
an instance of this C{LatLon}.
|
|
351
349
|
|
|
352
350
|
@raise PointsError: Insufficient number of B{C{points}}.
|
|
353
351
|
|
|
@@ -422,7 +420,7 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
|
|
|
422
420
|
conventionally) or C{None} for an interpolated height.
|
|
423
421
|
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{point}}
|
|
424
422
|
and/or B{C{other}} (C{bool}).
|
|
425
|
-
@kwarg tol: Convergence tolerance (C{
|
|
423
|
+
@kwarg tol: Convergence tolerance (C{meter}).
|
|
426
424
|
|
|
427
425
|
@return: The intersection point, an instance of this C{LatLon}.
|
|
428
426
|
|
|
@@ -572,10 +570,8 @@ def _Equidistant00(equidistant, p1):
|
|
|
572
570
|
if equidistant is None or not callable(equidistant):
|
|
573
571
|
equidistant = p1.Equidistant
|
|
574
572
|
else:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
t = map2(_dunder_nameof, Eqs)
|
|
578
|
-
raise _IsnotError(*t, equidistant=equidistant)
|
|
573
|
+
_xsubclassof(*_MODS.azimuthal._Equidistants,
|
|
574
|
+
equidistant=equidistant)
|
|
579
575
|
return equidistant(0, 0, p1.datum)
|
|
580
576
|
|
|
581
577
|
|
pygeodesy/ellipsoidalExact.py
CHANGED
|
@@ -24,7 +24,7 @@ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
|
|
|
24
24
|
# from math import fabs # from .karney
|
|
25
25
|
|
|
26
26
|
__all__ = _ALL_LAZY.ellipsoidalExact
|
|
27
|
-
__version__ = '
|
|
27
|
+
__version__ = '24.06.11'
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class Cartesian(CartesianEllipsoidalBase):
|
|
@@ -39,7 +39,7 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
39
39
|
B{datum}=...} to override this L{LatLon} class
|
|
40
40
|
or specify C{B{LatLon}=None}.
|
|
41
41
|
|
|
42
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
42
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
|
|
43
43
|
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
44
44
|
with C{C} and C{M} if available.
|
|
45
45
|
|
|
@@ -78,7 +78,7 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
78
78
|
L{Cartesian} class or set C{B{Cartesian}=None}.
|
|
79
79
|
|
|
80
80
|
@return: The cartesian (ECEF) coordinates as (L{Cartesian}) or if
|
|
81
|
-
B{
|
|
81
|
+
C{B{Cartesian} is None}, an L{Ecef9Tuple}C{(x, y, z, lat,
|
|
82
82
|
lon, height, C, M, datum)} with C{C} and C{M} if available.
|
|
83
83
|
|
|
84
84
|
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
|
|
@@ -24,7 +24,7 @@ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
|
|
|
24
24
|
# from math import fabs # from .karney
|
|
25
25
|
|
|
26
26
|
__all__ = _ALL_LAZY.ellipsoidalGeodSolve
|
|
27
|
-
__version__ = '24.
|
|
27
|
+
__version__ = '24.06.11'
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class Cartesian(CartesianEllipsoidalBase):
|
|
@@ -39,7 +39,7 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
39
39
|
B{datum}=...} to override this L{LatLon}
|
|
40
40
|
class or specify C{B{LatLon}=None}.
|
|
41
41
|
|
|
42
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
42
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
|
|
43
43
|
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
44
44
|
with C{C} and C{M} if available.
|
|
45
45
|
|
|
@@ -73,18 +73,15 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
73
73
|
def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
|
|
74
74
|
'''Convert this point to exact cartesian (ECEF) coordinates.
|
|
75
75
|
|
|
76
|
-
@kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
or set C{B{Cartesian}=None}.
|
|
76
|
+
@kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}} and other keyword
|
|
77
|
+
arguments, ignored if C{B{Cartesian} is None}. Use C{B{Cartesian}=Class}
|
|
78
|
+
to override this L{Cartesian} class or set C{B{Cartesian}=None}.
|
|
80
79
|
|
|
81
|
-
@return: The cartesian (ECEF) coordinates (L{Cartesian}) or if
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
available.
|
|
80
|
+
@return: The cartesian (ECEF) coordinates (L{Cartesian}) or if C{B{Cartesian} is
|
|
81
|
+
None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
|
|
82
|
+
C{C} and C{M} if available.
|
|
85
83
|
|
|
86
|
-
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
|
|
87
|
-
B{C{Cartesian_datum_kwds}}.
|
|
84
|
+
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other B{C{Cartesian_datum_kwds}}.
|
|
88
85
|
'''
|
|
89
86
|
kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
|
|
90
87
|
return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
|
|
@@ -93,25 +90,20 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
93
90
|
def areaOf(points, datum=_WGS84, wrap=True):
|
|
94
91
|
'''Compute the area of an (ellipsoidal) polygon or composite.
|
|
95
92
|
|
|
96
|
-
@arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
|
|
97
|
-
L{BooleanGH}).
|
|
93
|
+
@arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
|
|
98
94
|
@kwarg datum: Optional datum (L{Datum}).
|
|
99
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
|
|
100
|
-
B{C{points}} (C{bool}).
|
|
95
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
|
|
101
96
|
|
|
102
|
-
@return: Area (C{meter}, same as units of the B{C{datum}}'s
|
|
103
|
-
ellipsoid axes, I{squared}).
|
|
97
|
+
@return: Area (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes, I{squared}).
|
|
104
98
|
|
|
105
99
|
@raise PointsError: Insufficient number of B{C{points}}.
|
|
106
100
|
|
|
107
101
|
@raise TypeError: Some B{C{points}} are not L{LatLon}.
|
|
108
102
|
|
|
109
|
-
@raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
|
|
110
|
-
longitudes not supported.
|
|
103
|
+
@raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled longitudes not supported.
|
|
111
104
|
|
|
112
|
-
@see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf},
|
|
113
|
-
L{
|
|
114
|
-
and L{sphericalTrigonometry.areaOf}.
|
|
105
|
+
@see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf}, L{ellipsoidalKarney.areaOf},
|
|
106
|
+
L{sphericalNvector.areaOf} and L{sphericalTrigonometry.areaOf}.
|
|
115
107
|
'''
|
|
116
108
|
return fabs(_polygon(datum.ellipsoid.geodsolve, points, True, False, wrap))
|
|
117
109
|
|
pygeodesy/ellipsoidalKarney.py
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
u'''Ellipsoidal, I{Karney}-based geodesy.
|
|
5
5
|
|
|
6
|
-
Ellipsoidal geodetic (lat-/longitude) L{LatLon} and geocentric
|
|
7
|
-
|
|
8
|
-
L{
|
|
9
|
-
|
|
10
|
-
Python package to be installed.
|
|
6
|
+
Ellipsoidal geodetic (lat-/longitude) L{LatLon} and geocentric (ECEF) L{Cartesian}
|
|
7
|
+
classes and functions L{areaOf}, L{intersection3}, L{intersections2}, L{isclockwise},
|
|
8
|
+
L{nearestOn} and L{perimeterOf}, requiring I{Charles F.F. Karney}'s U{geographiclib
|
|
9
|
+
<https://PyPI.org/project/geographiclib>} Python package to be installed.
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
A usage example of C{ellipsoidalKarney}:
|
|
13
12
|
|
|
14
13
|
>>> from pygeodesy.ellipsoidalKarney import LatLon
|
|
15
14
|
>>> Newport_RI = LatLon(41.49008, -71.312796)
|
|
@@ -43,25 +42,23 @@ from pygeodesy.props import deprecated_method, Property_RO
|
|
|
43
42
|
# from math import fabs # from .karney
|
|
44
43
|
|
|
45
44
|
__all__ = _ALL_LAZY.ellipsoidalKarney
|
|
46
|
-
__version__ = '24.
|
|
45
|
+
__version__ = '24.06.11'
|
|
47
46
|
|
|
48
47
|
|
|
49
48
|
class Cartesian(CartesianEllipsoidalBase):
|
|
50
|
-
'''Extended to convert C{Karney}-based L{Cartesian} to
|
|
51
|
-
C{Karney}-based L{LatLon} points.
|
|
49
|
+
'''Extended to convert C{Karney}-based L{Cartesian} to C{Karney}-based L{LatLon} points.
|
|
52
50
|
'''
|
|
53
51
|
|
|
54
52
|
def toLatLon(self, **LatLon_and_kwds): # PYCHOK LatLon=LatLon, datum=None
|
|
55
53
|
'''Convert this cartesian point to a C{Karney}-based geodetic point.
|
|
56
54
|
|
|
57
|
-
@kwarg LatLon_and_kwds: Optional L{LatLon} and L{LatLon} keyword
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class or specify C{B{LatLon}=None}.
|
|
55
|
+
@kwarg LatLon_and_kwds: Optional L{LatLon} and L{LatLon} keyword arguments
|
|
56
|
+
as C{datum}. Use C{B{LatLon}=..., B{datum}=...} to override
|
|
57
|
+
this L{LatLon} class or specify C{B{LatLon}=None}.
|
|
61
58
|
|
|
62
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None}, an
|
|
60
|
+
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with C{C}
|
|
61
|
+
and C{M} if available.
|
|
65
62
|
|
|
66
63
|
@raise TypeError: Invalid B{C{LatLon_and_kwds}} argument.
|
|
67
64
|
'''
|
|
@@ -70,13 +67,9 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
70
67
|
|
|
71
68
|
|
|
72
69
|
class LatLon(LatLonEllipsoidalBaseDI):
|
|
73
|
-
'''An ellipsoidal L{LatLon} similar to L{ellipsoidalVincenty.LatLon}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
distances, bearings (azimuths), etc.
|
|
77
|
-
|
|
78
|
-
@note: This L{LatLon} class requires the U{geographiclib
|
|
79
|
-
<https://PyPI.org/project/geographiclib>} package.
|
|
70
|
+
'''An ellipsoidal L{LatLon} similar to L{ellipsoidalVincenty.LatLon} but using
|
|
71
|
+
I{Karney}'s Python U{geographiclib<https://PyPI.org/project/geographiclib>}
|
|
72
|
+
to compute geodesic distances, bearings (azimuths), etc.
|
|
80
73
|
'''
|
|
81
74
|
|
|
82
75
|
@deprecated_method
|
|
@@ -103,52 +96,41 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
103
96
|
def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
|
|
104
97
|
'''Convert this point to C{Karney}-based cartesian (ECEF) coordinates.
|
|
105
98
|
|
|
106
|
-
@kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
set C{B{Cartesian}=None}.
|
|
99
|
+
@kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}} and other keyword
|
|
100
|
+
arguments, ignored if C{B{Cartesian} is None}. Use C{B{Cartesian}=...} to
|
|
101
|
+
override this L{Cartesian} class or set C{B{Cartesian}=None}.
|
|
110
102
|
|
|
111
|
-
@return: The cartesian (ECEF) coordinates (L{Cartesian}) or if
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
available.
|
|
103
|
+
@return: The cartesian (ECEF) coordinates (L{Cartesian}) or if C{B{Cartesian} is
|
|
104
|
+
None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
|
|
105
|
+
C{C} and C{M} if available.
|
|
115
106
|
|
|
116
|
-
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
|
|
117
|
-
B{C{Cartesian_datum_kwds}}.
|
|
107
|
+
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other B{C{Cartesian_datum_kwds}}.
|
|
118
108
|
'''
|
|
119
109
|
kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
|
|
120
110
|
return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
|
|
121
111
|
|
|
122
112
|
|
|
123
113
|
def areaOf(points, datum=_WGS84, wrap=True):
|
|
124
|
-
'''Compute the area of an (ellipsoidal) polygon or composite
|
|
114
|
+
'''Compute the area of an (ellipsoidal) polygon or composite using I{Karney}'s
|
|
115
|
+
U{geographiclib<https://PyPI.org/project/geographiclib>} package.
|
|
125
116
|
|
|
126
|
-
@arg points: The polygon points (L{LatLon}[], L{BooleanFHP}
|
|
127
|
-
or L{BooleanGH}).
|
|
117
|
+
@arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
|
|
128
118
|
@kwarg datum: Optional datum (L{Datum}).
|
|
129
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
|
|
130
|
-
B{C{points}} (C{bool}).
|
|
119
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
|
|
131
120
|
|
|
132
|
-
@return: Area (C{meter}, same as units of the B{C{datum}}'s
|
|
133
|
-
ellipsoid axes, I{squared}).
|
|
121
|
+
@return: Area (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes, I{squared}).
|
|
134
122
|
|
|
135
|
-
@raise ImportError: Package U{geographiclib
|
|
136
|
-
<https://PyPI.org/project/geographiclib>}
|
|
123
|
+
@raise ImportError: Package U{geographiclib<https://PyPI.org/project/geographiclib>}
|
|
137
124
|
not installed or not found.
|
|
138
125
|
|
|
139
126
|
@raise PointsError: Insufficient number of B{C{points}}.
|
|
140
127
|
|
|
141
128
|
@raise TypeError: Some B{C{points}} are not L{LatLon}.
|
|
142
129
|
|
|
143
|
-
@raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
|
|
144
|
-
longitudes not supported.
|
|
145
|
-
|
|
146
|
-
@note: This function requires the U{geographiclib
|
|
147
|
-
<https://PyPI.org/project/geographiclib>} package.
|
|
130
|
+
@raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled longitudes not supported.
|
|
148
131
|
|
|
149
|
-
@see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf},
|
|
150
|
-
L{
|
|
151
|
-
and L{sphericalTrigonometry.areaOf}.
|
|
132
|
+
@see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf}, L{ellipsoidalGeodSolve.areaOf},
|
|
133
|
+
L{sphericalNvector.areaOf} and L{sphericalTrigonometry.areaOf}.
|
|
152
134
|
|
|
153
135
|
@note: The U{area of a polygon enclosing a pole<https://GeographicLib.SourceForge.io/
|
|
154
136
|
C++/doc/classGeographicLib_1_1GeodesicExact.html#a3d7a9155e838a09a48dc14d0c3fac525>}
|
|
@@ -259,7 +241,8 @@ def intersections2(center1, radius1, center2, radius2, height=None, wrap=False,
|
|
|
259
241
|
|
|
260
242
|
|
|
261
243
|
def isclockwise(points, datum=_WGS84, wrap=True):
|
|
262
|
-
'''Determine the direction of a path or polygon
|
|
244
|
+
'''Determine the direction of a path or polygon using I{Karney}'s
|
|
245
|
+
U{geographiclib<https://PyPI.org/project/geographiclib>} package.
|
|
263
246
|
|
|
264
247
|
@arg points: The path or polygon points (C{LatLon}[]).
|
|
265
248
|
@kwarg datum: Optional datum (L{Datum}).
|
|
@@ -276,11 +259,7 @@ def isclockwise(points, datum=_WGS84, wrap=True):
|
|
|
276
259
|
|
|
277
260
|
@raise TypeError: Some B{C{points}} are not C{LatLon}.
|
|
278
261
|
|
|
279
|
-
@raise ValueError: The B{C{points}} enclose a pole or zero
|
|
280
|
-
area.
|
|
281
|
-
|
|
282
|
-
@note: This function requires the U{geographiclib
|
|
283
|
-
<https://PyPI.org/project/geographiclib>} package.
|
|
262
|
+
@raise ValueError: The B{C{points}} enclose a pole or zero area.
|
|
284
263
|
|
|
285
264
|
@see: L{pygeodesy.isclockwise}.
|
|
286
265
|
'''
|
|
@@ -340,7 +319,8 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
|
|
|
340
319
|
|
|
341
320
|
|
|
342
321
|
def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
|
|
343
|
-
'''Compute the perimeter of an (ellipsoidal) polygon or composite
|
|
322
|
+
'''Compute the perimeter of an (ellipsoidal) polygon or composite using I{Karney}'s
|
|
323
|
+
U{geographiclib<https://PyPI.org/project/geographiclib>} package.
|
|
344
324
|
|
|
345
325
|
@arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
|
|
346
326
|
L{BooleanGH}).
|
|
@@ -365,9 +345,6 @@ def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
|
|
|
365
345
|
longitudes not supported or C{B{closed}=False}
|
|
366
346
|
with C{B{points}} a composite.
|
|
367
347
|
|
|
368
|
-
@note: This function requires the U{geographiclib
|
|
369
|
-
<https://PyPI.org/project/geographiclib>} package.
|
|
370
|
-
|
|
371
348
|
@see: Functions L{pygeodesy.perimeterOf}, L{ellipsoidalExact.perimeterOf},
|
|
372
349
|
L{ellipsoidalGeodSolve.perimeterOf}, L{sphericalNvector.perimeterOf}
|
|
373
350
|
and L{sphericalTrigonometry.perimeterOf}.
|
pygeodesy/ellipsoidalNvector.py
CHANGED
|
@@ -23,13 +23,13 @@ The Journal of Navigation (2010), vol 63, nr 3, pp 395-417.
|
|
|
23
23
|
# make sure int/int division yields float quotient, see .basics
|
|
24
24
|
from __future__ import division as _; del _ # PYCHOK semicolon
|
|
25
25
|
|
|
26
|
-
from pygeodesy.basics import issubclassof, map2, _xinstanceof
|
|
26
|
+
from pygeodesy.basics import issubclassof, map2, _xinstanceof, _xsubclassof
|
|
27
27
|
from pygeodesy.datums import _earth_ellipsoid, _ellipsoidal_datum, _WGS84
|
|
28
28
|
# from pygeodesy.dms import F_D, toDMS # _MODS
|
|
29
29
|
from pygeodesy.ellipsoidalBase import CartesianEllipsoidalBase, \
|
|
30
30
|
_nearestOn, LatLonEllipsoidalBase, \
|
|
31
31
|
_TOL_M, _Wrap
|
|
32
|
-
from pygeodesy.errors import
|
|
32
|
+
from pygeodesy.errors import _xkwds, _xkwds_pop2
|
|
33
33
|
# from pygeodesy.fmath import fdot # from .nvectorBase
|
|
34
34
|
from pygeodesy.interns import _Nv00_, _COMMASPACE_, _pole_ # PYCHOK used!
|
|
35
35
|
from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
|
|
@@ -48,7 +48,7 @@ from pygeodesy.units import Bearing, Distance, Height, Scalar
|
|
|
48
48
|
# from math import fabs # from .nvectorBase
|
|
49
49
|
|
|
50
50
|
__all__ = _ALL_LAZY.ellipsoidalNvector
|
|
51
|
-
__version__ = '24.06.
|
|
51
|
+
__version__ = '24.06.15'
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
class Ned(_Ned):
|
|
@@ -95,9 +95,9 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
95
95
|
override this L{LatLon} class or specify
|
|
96
96
|
C{B{LatLon} is None}.
|
|
97
97
|
|
|
98
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
|
|
99
|
+
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
100
|
+
with C{C} and C{M} if available.
|
|
101
101
|
|
|
102
102
|
@raise TypeError: Invalid B{C{LatLon_and_kwds}}.
|
|
103
103
|
'''
|
|
@@ -112,8 +112,8 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
112
112
|
override this C{Nvector} class or specify
|
|
113
113
|
C{B{Nvector} is None}.
|
|
114
114
|
|
|
115
|
-
@return: The C{n-vector} components (C{Nvector}) or if B{
|
|
116
|
-
is
|
|
115
|
+
@return: The C{n-vector} components (C{Nvector}) or if C{B{Nvector}
|
|
116
|
+
is None}, a L{Vector4Tuple}C{(x, y, z, h)}.
|
|
117
117
|
|
|
118
118
|
@raise TypeError: Invalid B{C{Nvector_and_kwds}}.
|
|
119
119
|
'''
|
|
@@ -176,9 +176,9 @@ class LatLon(LatLonNvectorBase, LatLonEllipsoidalBase):
|
|
|
176
176
|
|
|
177
177
|
@return: Delta from this to the other point (B{C{Ned}}).
|
|
178
178
|
|
|
179
|
-
@raise TypeError: The B{C{other}} point is not L{LatLon} or
|
|
180
|
-
|
|
181
|
-
L{pygeodesy.
|
|
179
|
+
@raise TypeError: The B{C{other}} point is not L{LatLon} or B{C{Ned}}
|
|
180
|
+
is not an L{Ned4Tuple<pygeodesy.Ned4Tuple>} nor an
|
|
181
|
+
L{Ned<pygeodesy.Ned>} nor a DEPRECATED L{Ned}.
|
|
182
182
|
|
|
183
183
|
@raise ValueError: If ellipsoids are incompatible.
|
|
184
184
|
'''
|
|
@@ -196,8 +196,8 @@ class LatLon(LatLonNvectorBase, LatLonEllipsoidalBase):
|
|
|
196
196
|
N, kwds = _xkwds_pop2(Ned_and_kwds, Ned=Ned)
|
|
197
197
|
if issubclassof(N, Ned4Tuple):
|
|
198
198
|
ned_ += _MODS.ltp.Ltp(self, ecef=self.Ecef(self.datum)),
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
else:
|
|
200
|
+
_xsubclassof(_Ned, Ned4Tuple, Ned=N)
|
|
201
201
|
return N(*ned_, **_xkwds(kwds, name=self.name))
|
|
202
202
|
|
|
203
203
|
# def destination(self, distance, bearing, radius=R_M, height=None):
|
|
@@ -223,7 +223,7 @@ class LatLon(LatLonNvectorBase, LatLonEllipsoidalBase):
|
|
|
223
223
|
# y = gc.cross(v1).times(sin(r)) # component of v2 perpendicular to v1
|
|
224
224
|
#
|
|
225
225
|
# v2 = x.plus(y).unit()
|
|
226
|
-
# return v2.toLatLon(height=self.height
|
|
226
|
+
# return v2.toLatLon(height=self._heigHt(height))
|
|
227
227
|
|
|
228
228
|
def destinationNed(self, delta):
|
|
229
229
|
'''Calculate the destination point using the supplied NED delta
|
|
@@ -234,8 +234,8 @@ class LatLon(LatLonNvectorBase, LatLonEllipsoidalBase):
|
|
|
234
234
|
|
|
235
235
|
@return: Destination point (L{LatLon}).
|
|
236
236
|
|
|
237
|
-
@raise TypeError: If B{C{delta}} is not L{pygeodesy.Ned}
|
|
238
|
-
DEPRECATED L{Ned}.
|
|
237
|
+
@raise TypeError: If B{C{delta}} is not an L{Ned<pygeodesy.Ned>}
|
|
238
|
+
or a DEPRECATED L{Ned}.
|
|
239
239
|
'''
|
|
240
240
|
_xinstanceof(_Ned, delta=delta)
|
|
241
241
|
|
|
@@ -391,9 +391,9 @@ class LatLon(LatLonNvectorBase, LatLonEllipsoidalBase):
|
|
|
391
391
|
to override this L{Cartesian} class or specify
|
|
392
392
|
C{B{Cartesian}=None}.
|
|
393
393
|
|
|
394
|
-
@return: The geodetic point (L{Cartesian}) or if B{
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
@return: The geodetic point (L{Cartesian}) or if C{B{Cartesian} is None},
|
|
395
|
+
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
|
|
396
|
+
C{C} and C{M} if available.
|
|
397
397
|
|
|
398
398
|
@raise TypeError: Invalid B{C{Cartesian}} or other B{C{Cartesian_and_kwds}}.
|
|
399
399
|
'''
|
|
@@ -476,9 +476,9 @@ class Nvector(NvectorBase):
|
|
|
476
476
|
to override this L{Cartesian} class or specify
|
|
477
477
|
C{B{Cartesian} is None}.
|
|
478
478
|
|
|
479
|
-
@return: The cartesian point (L{Cartesian}) or if B{
|
|
480
|
-
|
|
481
|
-
|
|
479
|
+
@return: The cartesian point (L{Cartesian}) or if C{B{Cartesian} is None},
|
|
480
|
+
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
|
|
481
|
+
C{C} and C{M} if available.
|
|
482
482
|
|
|
483
483
|
@raise TypeError: Invalid B{C{Cartesian_and_kwds}}.
|
|
484
484
|
'''
|
|
@@ -494,9 +494,9 @@ class Nvector(NvectorBase):
|
|
|
494
494
|
to override this L{LatLon} class or specify
|
|
495
495
|
C{B{LatLon} is None}.
|
|
496
496
|
|
|
497
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
498
|
-
|
|
499
|
-
|
|
497
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
|
|
498
|
+
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
499
|
+
with C{C} and C{M} if available.
|
|
500
500
|
|
|
501
501
|
@raise TypeError: Invalid B{C{LatLon_and_kwds}}.
|
|
502
502
|
'''
|
|
@@ -528,29 +528,23 @@ def meanOf(points, datum=_WGS84, height=None, wrap=False,
|
|
|
528
528
|
|
|
529
529
|
@arg points: Points to be averaged (L{LatLon}[]).
|
|
530
530
|
@kwarg datum: Optional datum to use (L{Datum}).
|
|
531
|
-
@kwarg height: Optional height at mean point, overriding
|
|
532
|
-
|
|
533
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} B{C{points}}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
@return: Geographic mean point and mean height (B{C{LatLon}})
|
|
542
|
-
or if B{C{LatLon}} is C{None}, an L{Ecef9Tuple}C{(x,
|
|
543
|
-
y, z, lat, lon, height, C, M, datum)} with C{C} and
|
|
544
|
-
C{M} if available.
|
|
531
|
+
@kwarg height: Optional height at mean point, overriding the mean
|
|
532
|
+
height (C{meter}).
|
|
533
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} B{C{points}} (C{bool}).
|
|
534
|
+
@kwarg LatLon_and_kwds: Optional B{C{LatLon}} class to return the mean
|
|
535
|
+
points (or C{None}) and additional B{C{LatLon}} keyword
|
|
536
|
+
arguments, ignored if C{B{LatLon} is None}.
|
|
537
|
+
|
|
538
|
+
@return: Geographic mean point and height (B{C{LatLon}}) or if C{B{LatLon}
|
|
539
|
+
is None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
|
|
540
|
+
datum)} with C{C} and C{M} if available.
|
|
545
541
|
|
|
546
542
|
@raise ValueError: Insufficient number of B{C{points}}.
|
|
547
543
|
'''
|
|
548
544
|
Ps = _Nvll.PointsIter(points, wrap=wrap)
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
LatLon=LatLon, name__=meanOf)
|
|
553
|
-
return m.toLatLon(**kwds)
|
|
545
|
+
n = sumOf(p._N_vector for p in Ps.iterate(closed=False))
|
|
546
|
+
return n.toLatLon(**_xkwds(LatLon_and_kwds, height=height, datum=datum,
|
|
547
|
+
LatLon=LatLon, name__=meanOf))
|
|
554
548
|
|
|
555
549
|
|
|
556
550
|
def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
|
pygeodesy/ellipsoidalVincenty.py
CHANGED
|
@@ -72,7 +72,7 @@ from pygeodesy.utily import atan2b, atan2d, sincos2, sincos2d, unroll180, wrap18
|
|
|
72
72
|
from math import atan2, cos, degrees, fabs, radians, tan
|
|
73
73
|
|
|
74
74
|
__all__ = _ALL_LAZY.ellipsoidalVincenty
|
|
75
|
-
__version__ = '
|
|
75
|
+
__version__ = '24.06.11'
|
|
76
76
|
|
|
77
77
|
_antipodal_to_ = _SPACE_(_antipodal_, _to_)
|
|
78
78
|
|
|
@@ -102,7 +102,7 @@ class Cartesian(CartesianEllipsoidalBase):
|
|
|
102
102
|
B{datum}=...} to override this L{LatLon}
|
|
103
103
|
class or specify C{B{LatLon}=None}.
|
|
104
104
|
|
|
105
|
-
@return: The geodetic point (L{LatLon}) or if B{
|
|
105
|
+
@return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
|
|
106
106
|
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
107
107
|
with C{C} and C{M} if available.
|
|
108
108
|
|
|
@@ -175,20 +175,18 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
175
175
|
self._iterations = Number_(limit, name=_limit_, low=4, high=1000) + 1
|
|
176
176
|
|
|
177
177
|
def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
|
|
178
|
-
'''Convert this point to C{Vincenty}-based cartesian (ECEF)
|
|
179
|
-
coordinates.
|
|
178
|
+
'''Convert this point to C{Vincenty}-based cartesian (ECEF) coordinates.
|
|
180
179
|
|
|
181
180
|
@kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}} and other
|
|
182
181
|
keyword arguments, ignored if C{B{Cartesian}=None}. Use
|
|
183
182
|
C{B{Cartesian}=...} to override this L{Cartesian} class
|
|
184
183
|
or specify C{B{Cartesian}=None}.
|
|
185
184
|
|
|
186
|
-
@return: The cartesian point (L{Cartesian}) or if B{
|
|
187
|
-
|
|
188
|
-
C
|
|
185
|
+
@return: The cartesian point (L{Cartesian}) or if C{B{Cartesian} is None},
|
|
186
|
+
an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
|
|
187
|
+
C{C} and C{M} if available.
|
|
189
188
|
|
|
190
|
-
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
|
|
191
|
-
B{C{Cartesian_datum_kwds}}.
|
|
189
|
+
@raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other B{C{Cartesian_datum_kwds}}.
|
|
192
190
|
'''
|
|
193
191
|
kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian,
|
|
194
192
|
datum=self.datum)
|
|
@@ -199,12 +197,11 @@ class LatLon(LatLonEllipsoidalBaseDI):
|
|
|
199
197
|
|
|
200
198
|
@raise TypeError: The B{C{other}} point is not L{LatLon}.
|
|
201
199
|
|
|
202
|
-
@raise ValueError: If this and the B{C{other}} point's L{Datum}
|
|
203
|
-
|
|
200
|
+
@raise ValueError: If this and the B{C{other}} point's L{Datum} ellipsoids are
|
|
201
|
+
not compatible.
|
|
204
202
|
|
|
205
|
-
@raise VincentyError: Vincenty fails to converge for the current
|
|
206
|
-
L{LatLon.epsilon} and L{LatLon.iterations}
|
|
207
|
-
limits.
|
|
203
|
+
@raise VincentyError: Vincenty fails to converge for the current limits, see
|
|
204
|
+
L{epsilon<LatLon.epsilon>} and L{iterations<LatLon.iterations>}.
|
|
208
205
|
'''
|
|
209
206
|
E = self.ellipsoid()
|
|
210
207
|
f = E.f
|