pygeodesy 24.5.15__py2.py3-none-any.whl → 24.6.1__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.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/METADATA +6 -5
- PyGeodesy-24.6.1.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +4 -4
- pygeodesy/albers.py +41 -41
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +2 -2
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +80 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +46 -10
- pygeodesy/booleans.py +13 -14
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/constants.py +3 -3
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +42 -41
- pygeodesy/deprecated/functions.py +9 -3
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +41 -41
- pygeodesy/ellipsoidalBase.py +41 -41
- pygeodesy/ellipsoidalBaseDI.py +3 -4
- pygeodesy/ellipsoidalGeodSolve.py +2 -2
- pygeodesy/ellipsoidalKarney.py +3 -3
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +45 -38
- pygeodesy/elliptic.py +3 -4
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +52 -20
- pygeodesy/etm.py +68 -65
- pygeodesy/fmath.py +44 -49
- pygeodesy/formy.py +129 -115
- pygeodesy/frechet.py +118 -103
- pygeodesy/fstats.py +21 -14
- pygeodesy/fsums.py +124 -80
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +19 -17
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +2 -2
- pygeodesy/geodesicx/gx.py +39 -33
- pygeodesy/geodesicx/gxarea.py +12 -9
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +29 -28
- pygeodesy/geohash.py +60 -57
- pygeodesy/geoids.py +34 -32
- pygeodesy/hausdorff.py +114 -101
- pygeodesy/heights.py +137 -130
- pygeodesy/internals.py +16 -11
- pygeodesy/interns.py +3 -6
- pygeodesy/iters.py +19 -17
- pygeodesy/karney.py +21 -17
- pygeodesy/ktm.py +25 -18
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +6 -6
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +143 -113
- pygeodesy/ltpTuples.py +207 -150
- pygeodesy/mgrs.py +26 -26
- pygeodesy/named.py +172 -90
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +8 -8
- pygeodesy/osgr.py +40 -48
- pygeodesy/points.py +18 -18
- pygeodesy/props.py +29 -16
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +13 -15
- pygeodesy/rhumb/bases.py +12 -5
- pygeodesy/rhumb/ekx.py +24 -18
- pygeodesy/rhumb/solve.py +13 -10
- pygeodesy/simplify.py +16 -16
- pygeodesy/solveBase.py +18 -18
- pygeodesy/sphericalBase.py +17 -21
- pygeodesy/sphericalTrigonometry.py +21 -21
- pygeodesy/streprs.py +5 -5
- pygeodesy/trf.py +13 -11
- pygeodesy/triaxials.py +68 -64
- pygeodesy/units.py +35 -35
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/ups.py +66 -70
- pygeodesy/utily.py +3 -3
- pygeodesy/utm.py +183 -187
- pygeodesy/utmups.py +38 -38
- pygeodesy/utmupsBase.py +104 -106
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +4 -5
- pygeodesy/webmercator.py +43 -51
- PyGeodesy-24.5.15.dist-info/RECORD +0 -116
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/top_level.txt +0 -0
pygeodesy/geodesicx/gx.py
CHANGED
|
@@ -43,16 +43,16 @@ from pygeodesy.constants import EPS, EPS0, EPS02, MANT_DIG, NAN, PI, _EPSqrt, \
|
|
|
43
43
|
_4_0, _6_0, _8_0, _16_0, _90_0, _180_0, _1000_0
|
|
44
44
|
from pygeodesy.datums import _earth_datum, _WGS84, _EWGS84
|
|
45
45
|
# from pygeodesy.ellipsoids import _EWGS84 # from .datums
|
|
46
|
+
from pygeodesy.errors import GeodesicError, _xkwds_pop2
|
|
46
47
|
from pygeodesy.fmath import hypot as _hypot
|
|
47
48
|
from pygeodesy.fsums import fsumf_, fsum1f_
|
|
48
49
|
from pygeodesy.geodesicx.gxbases import _cosSeries, _GeodesicBase, \
|
|
49
50
|
_sincos12, _sin1cos2, _xnC4
|
|
50
51
|
from pygeodesy.geodesicx.gxline import _GeodesicLineExact, _TINY, _update_glXs
|
|
51
52
|
from pygeodesy.interns import NN, _COMMASPACE_, _DOT_, _UNDER_
|
|
52
|
-
from pygeodesy.karney import _around, _atan2d, Caps, _cbrt, _diff182, \
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_sincos2, _sincos2d, _sincos2de, _unsigned2
|
|
53
|
+
from pygeodesy.karney import GDict, _around, _atan2d, Caps, _cbrt, _diff182, \
|
|
54
|
+
_fix90, _K_2_0, _norm2, _norm180, _polynomial, \
|
|
55
|
+
_signBit, _sincos2, _sincos2d, _sincos2de, _unsigned2
|
|
56
56
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS
|
|
57
57
|
from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple
|
|
58
58
|
from pygeodesy.props import deprecated_Property, Property, Property_RO, property_RO
|
|
@@ -62,7 +62,7 @@ from pygeodesy.utily import atan2d as _atan2d_reverse, _unrollon, _Wrap, wrap360
|
|
|
62
62
|
from math import atan2, copysign, cos, degrees, fabs, radians, sqrt
|
|
63
63
|
|
|
64
64
|
__all__ = ()
|
|
65
|
-
__version__ = '24.
|
|
65
|
+
__version__ = '24.05.31'
|
|
66
66
|
|
|
67
67
|
_MAXIT1 = 20
|
|
68
68
|
_MAXIT2 = 10 + _MAXIT1 + MANT_DIG # MANT_DIG == C++ digits
|
|
@@ -134,8 +134,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
134
134
|
_datum = _WGS84
|
|
135
135
|
_nC4 = 30 # default C4order
|
|
136
136
|
|
|
137
|
-
def __init__(self, a_ellipsoid=_EWGS84, f=None,
|
|
138
|
-
C4Order=None): # for backward compatibility
|
|
137
|
+
def __init__(self, a_ellipsoid=_EWGS84, f=None, C4order=None, **name_C4Order): # for backward compatibility
|
|
139
138
|
'''New L{GeodesicExact} instance.
|
|
140
139
|
|
|
141
140
|
@arg a_ellipsoid: An ellipsoid (L{Ellipsoid}) or datum (L{Datum}) or
|
|
@@ -143,20 +142,23 @@ class GeodesicExact(_GeodesicBase):
|
|
|
143
142
|
conventionally in C{meter}), see B{C{f}}.
|
|
144
143
|
@arg f: The flattening of the ellipsoid (C{scalar}) if B{C{a_ellipsoid}}
|
|
145
144
|
is specified as C{scalar}.
|
|
146
|
-
@kwarg name: Optional name (C{str}).
|
|
147
145
|
@kwarg C4order: Optional series expansion order (C{int}), see property
|
|
148
146
|
L{C4order}, default C{30}.
|
|
149
|
-
@kwarg
|
|
147
|
+
@kwarg name_C4Order: Optional C{B{name}=NN} (C{str}) and the DEPRECATED
|
|
148
|
+
keyword argument C{C4Order}, use B{C{C4order}} instead.
|
|
150
149
|
|
|
151
150
|
@raise GeodesicError: Invalid B{C{C4order}}.
|
|
152
151
|
'''
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
if name_C4Order:
|
|
153
|
+
C4order, name = _xkwds_pop2(name_C4Order, C4Order=C4order)
|
|
154
|
+
if name:
|
|
155
|
+
self.name = name
|
|
156
|
+
else:
|
|
157
|
+
name = {} # name_C4Order
|
|
158
|
+
|
|
159
|
+
_earth_datum(self, a_ellipsoid, f=f, **name)
|
|
156
160
|
if C4order: # XXX private copy, always?
|
|
157
161
|
self.C4order = C4order
|
|
158
|
-
elif C4Order: # for backward compatibility
|
|
159
|
-
self.C4Order = C4Order
|
|
160
162
|
|
|
161
163
|
@Property_RO
|
|
162
164
|
def a(self):
|
|
@@ -184,7 +186,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
184
186
|
'''
|
|
185
187
|
return self._GDictDirect(lat1, lon1, azi1, True, a12, outmask)
|
|
186
188
|
|
|
187
|
-
def ArcDirectLine(self, lat1, lon1, azi1, a12, caps=Caps.ALL, name
|
|
189
|
+
def ArcDirectLine(self, lat1, lon1, azi1, a12, caps=Caps.ALL, **name):
|
|
188
190
|
'''Define a L{GeodesicLineExact} in terms of the I{direct} geodesic problem and as arc length.
|
|
189
191
|
|
|
190
192
|
@arg lat1: Latitude of the first point (C{degrees}).
|
|
@@ -196,6 +198,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
196
198
|
should possess, i.e., which quantities can be
|
|
197
199
|
returned by calls to L{GeodesicLineExact.Position}
|
|
198
200
|
and L{GeodesicLineExact.ArcPosition}.
|
|
201
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
199
202
|
|
|
200
203
|
@return: A L{GeodesicLineExact} instance.
|
|
201
204
|
|
|
@@ -208,15 +211,15 @@ class GeodesicExact(_GeodesicBase):
|
|
|
208
211
|
<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>} and
|
|
209
212
|
Python U{Geodesic.ArcDirectLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
|
|
210
213
|
'''
|
|
211
|
-
return self._GenDirectLine(lat1, lon1, azi1, True, a12, caps, name
|
|
214
|
+
return self._GenDirectLine(lat1, lon1, azi1, True, a12, caps, **name)
|
|
212
215
|
|
|
213
|
-
def Area(self, polyline=False, name
|
|
216
|
+
def Area(self, polyline=False, **name):
|
|
214
217
|
'''Set up a L{GeodesicAreaExact} to compute area and
|
|
215
218
|
perimeter of a polygon.
|
|
216
219
|
|
|
217
220
|
@kwarg polyline: If C{True} perimeter only, otherwise
|
|
218
221
|
area and perimeter (C{bool}).
|
|
219
|
-
@kwarg name: Optional name (C{str}).
|
|
222
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
220
223
|
|
|
221
224
|
@return: A L{GeodesicAreaExact} instance.
|
|
222
225
|
|
|
@@ -224,7 +227,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
224
227
|
to the returned L{GeodesicAreaExact} instance.
|
|
225
228
|
'''
|
|
226
229
|
gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline,
|
|
227
|
-
name=
|
|
230
|
+
name=self._name__(name))
|
|
228
231
|
if self.debug:
|
|
229
232
|
gaX.verbose = True
|
|
230
233
|
return gaX
|
|
@@ -313,7 +316,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
313
316
|
def _C4(nC4):
|
|
314
317
|
i, n, cs = 0, self.n, _C4coeffs(nC4)
|
|
315
318
|
_p = _polynomial
|
|
316
|
-
for r in range(nC4 + 1, 1, -1):
|
|
319
|
+
for r in range(nC4 + 1, 1, -1): # _reverange
|
|
317
320
|
for j in range(1, r):
|
|
318
321
|
j = j + i # (j - i - 1) order of polynomial
|
|
319
322
|
yield _p(n, cs, i, j) / cs[j]
|
|
@@ -362,7 +365,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
362
365
|
'''
|
|
363
366
|
return self.DirectLine(ll1.lat, ll1.lon, azi12, s12, **caps_name)
|
|
364
367
|
|
|
365
|
-
def DirectLine(self, lat1, lon1, azi1, s12, caps=Caps.STANDARD, name
|
|
368
|
+
def DirectLine(self, lat1, lon1, azi1, s12, caps=Caps.STANDARD, **name):
|
|
366
369
|
'''Define a L{GeodesicLineExact} in terms of the I{direct} geodesic problem and as distance.
|
|
367
370
|
|
|
368
371
|
@arg lat1: Latitude of the first point (C{degrees}).
|
|
@@ -373,6 +376,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
373
376
|
the capabilities the L{GeodesicLineExact} instance
|
|
374
377
|
should possess, i.e., which quantities can be
|
|
375
378
|
returned by calls to L{GeodesicLineExact.Position}.
|
|
379
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
376
380
|
|
|
377
381
|
@return: A L{GeodesicLineExact} instance.
|
|
378
382
|
|
|
@@ -385,7 +389,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
385
389
|
<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>} and
|
|
386
390
|
Python U{Geodesic.DirectLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
|
|
387
391
|
'''
|
|
388
|
-
return self._GenDirectLine(lat1, lon1, azi1, False, s12, caps, name
|
|
392
|
+
return self._GenDirectLine(lat1, lon1, azi1, False, s12, caps, **name)
|
|
389
393
|
|
|
390
394
|
def _dn(self, sbet, cbet): # in gxline._GeodesicLineExact.__init__
|
|
391
395
|
'''(INTERNAL) Helper.
|
|
@@ -691,7 +695,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
691
695
|
eFk2=eF.k2, eFa2=eF.alpha2)
|
|
692
696
|
p.update(r) # r overrides p
|
|
693
697
|
r = p.toGDict()
|
|
694
|
-
return self._iter2tion(r, p)
|
|
698
|
+
return self._iter2tion(r, **p)
|
|
695
699
|
|
|
696
700
|
def _GenDirect(self, lat1, lon1, azi1, arcmode, s12_a12, outmask=Caps.STANDARD):
|
|
697
701
|
'''(INTERNAL) The general I{Inverse} geodesic calculation.
|
|
@@ -702,7 +706,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
702
706
|
r = self._GDictDirect(lat1, lon1, azi1, arcmode, s12_a12, outmask)
|
|
703
707
|
return r.toDirect9Tuple()
|
|
704
708
|
|
|
705
|
-
def _GenDirectLine(self, lat1, lon1, azi1, arcmode, s12_a12, caps, name
|
|
709
|
+
def _GenDirectLine(self, lat1, lon1, azi1, arcmode, s12_a12, caps, **name):
|
|
706
710
|
'''(INTERNAL) Helper for C{ArcDirectLine} and C{DirectLine}.
|
|
707
711
|
|
|
708
712
|
@return: A L{GeodesicLineExact} instance.
|
|
@@ -712,7 +716,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
712
716
|
s, c = _sincos2d(_around(azi1))
|
|
713
717
|
C = caps if arcmode else (caps | Caps.DISTANCE_IN)
|
|
714
718
|
return _GeodesicLineExact(self, lat1, lon1, azi1, C,
|
|
715
|
-
self._debug, s, c, name
|
|
719
|
+
self._debug, s, c, **name)._GenSet(arcmode, s12_a12)
|
|
716
720
|
|
|
717
721
|
def _GenInverse(self, lat1, lon1, lat2, lon2, outmask=Caps.STANDARD):
|
|
718
722
|
'''(INTERNAL) The general I{Inverse} geodesic calculation.
|
|
@@ -784,7 +788,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
784
788
|
ll2 = _unrollon(ll1, _Wrap.point(ll2))
|
|
785
789
|
return self.InverseLine(ll1.lat, ll1.lon, ll2.lat, ll2.lon, **caps_name)
|
|
786
790
|
|
|
787
|
-
def InverseLine(self, lat1, lon1, lat2, lon2, caps=Caps.STANDARD, name
|
|
791
|
+
def InverseLine(self, lat1, lon1, lat2, lon2, caps=Caps.STANDARD, **name):
|
|
788
792
|
'''Define a L{GeodesicLineExact} in terms of the I{Inverse} geodesic problem.
|
|
789
793
|
|
|
790
794
|
@arg lat1: Latitude of the first point (C{degrees}).
|
|
@@ -796,6 +800,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
796
800
|
should possess, i.e., which quantities can be
|
|
797
801
|
returned by calls to L{GeodesicLineExact.Position}
|
|
798
802
|
and L{GeodesicLineExact.ArcPosition}.
|
|
803
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
799
804
|
|
|
800
805
|
@return: A L{GeodesicLineExact} instance.
|
|
801
806
|
|
|
@@ -813,7 +818,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
813
818
|
C = (caps | Cs.DISTANCE) if (caps & (Cs.DISTANCE_IN & Cs._OUT_MASK)) else caps
|
|
814
819
|
azi1 = _atan2d(r.salp1, r.calp1)
|
|
815
820
|
return _GeodesicLineExact(self, lat1, lon1, azi1, C, # ensure a12 is distance
|
|
816
|
-
self._debug, r.salp1, r.calp1, name
|
|
821
|
+
self._debug, r.salp1, r.calp1, **name)._GenSet(True, r.a12)
|
|
817
822
|
|
|
818
823
|
def _InverseArea(self, _meridian, salp1, calp1, # PYCHOK 9 args
|
|
819
824
|
salp2, calp2,
|
|
@@ -1100,7 +1105,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
1100
1105
|
|
|
1101
1106
|
return s12b, m12b, m0, M12, M21
|
|
1102
1107
|
|
|
1103
|
-
def Line(self, lat1, lon1, azi1, caps=Caps.ALL, name
|
|
1108
|
+
def Line(self, lat1, lon1, azi1, caps=Caps.ALL, **name):
|
|
1104
1109
|
'''Set up a L{GeodesicLineExact} to compute several points
|
|
1105
1110
|
on a single geodesic.
|
|
1106
1111
|
|
|
@@ -1112,6 +1117,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
1112
1117
|
should possess, i.e., which quantities can be
|
|
1113
1118
|
returnedby calls to L{GeodesicLineExact.Position}
|
|
1114
1119
|
and L{GeodesicLineExact.ArcPosition}.
|
|
1120
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1115
1121
|
|
|
1116
1122
|
@return: A L{GeodesicLineExact} instance.
|
|
1117
1123
|
|
|
@@ -1123,7 +1129,7 @@ class GeodesicExact(_GeodesicBase):
|
|
|
1123
1129
|
<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>}
|
|
1124
1130
|
and Python U{Geodesic.Line<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
|
|
1125
1131
|
'''
|
|
1126
|
-
return _GeodesicLineExact(self, lat1, lon1, azi1, caps, self._debug, name
|
|
1132
|
+
return _GeodesicLineExact(self, lat1, lon1, azi1, caps, self._debug, **name)
|
|
1127
1133
|
|
|
1128
1134
|
@Property_RO
|
|
1129
1135
|
def n(self):
|
|
@@ -1265,7 +1271,7 @@ class GeodesicLineExact(_GeodesicLineExact):
|
|
|
1265
1271
|
geographiclib/geographiclib-python>}.
|
|
1266
1272
|
'''
|
|
1267
1273
|
|
|
1268
|
-
def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.STANDARD, name
|
|
1274
|
+
def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.STANDARD, **name):
|
|
1269
1275
|
'''New L{GeodesicLineExact} instance, allowing points to be found along
|
|
1270
1276
|
a geodesic starting at C{(B{lat1}, B{lon1})} with azimuth B{C{azi1}}.
|
|
1271
1277
|
|
|
@@ -1278,15 +1284,15 @@ class GeodesicLineExact(_GeodesicLineExact):
|
|
|
1278
1284
|
should possess, i.e., which quantities can be
|
|
1279
1285
|
returned by calls to L{GeodesicLineExact.Position}
|
|
1280
1286
|
and L{GeodesicLineExact.ArcPosition}.
|
|
1281
|
-
@kwarg name: Optional name (C{str}).
|
|
1287
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1282
1288
|
|
|
1283
1289
|
@raise TypeError: Invalid B{C{geodesic}}.
|
|
1284
1290
|
'''
|
|
1285
1291
|
_xinstanceof(GeodesicExact, geodesic=geodesic)
|
|
1286
1292
|
if (caps & Caps.LINE_OFF): # copy to avoid updates
|
|
1287
|
-
geodesic = geodesic.copy(deep=False, name=NN
|
|
1293
|
+
geodesic = geodesic.copy(deep=False, name=_UNDER_(NN, geodesic.name)) # NOT _under!
|
|
1288
1294
|
# _update_all(geodesic)
|
|
1289
|
-
_GeodesicLineExact.__init__(self, geodesic, lat1, lon1, azi1, caps, 0, name
|
|
1295
|
+
_GeodesicLineExact.__init__(self, geodesic, lat1, lon1, azi1, caps, 0, **name)
|
|
1290
1296
|
|
|
1291
1297
|
|
|
1292
1298
|
def _Astroid(x, y):
|
pygeodesy/geodesicx/gxarea.py
CHANGED
|
@@ -19,10 +19,10 @@ from __future__ import division as _; del _ # PYCHOK semicolon
|
|
|
19
19
|
|
|
20
20
|
from pygeodesy.basics import isodd, unsigned0
|
|
21
21
|
from pygeodesy.constants import NAN, _0_0, _0_5, _720_0
|
|
22
|
-
from pygeodesy.interns import
|
|
22
|
+
# from pygeodesy.interns import _COMMASPACE_ # from .lazily
|
|
23
23
|
from pygeodesy.karney import Area3Tuple, _diff182, GeodesicError, \
|
|
24
24
|
_norm180, _remainder, _sum2_
|
|
25
|
-
from pygeodesy.lazily import _ALL_DOCS, printf
|
|
25
|
+
from pygeodesy.lazily import _ALL_DOCS, printf, _COMMASPACE_
|
|
26
26
|
from pygeodesy.named import ADict, callername, _NamedBase, pairs
|
|
27
27
|
from pygeodesy.props import Property, Property_RO, property_RO
|
|
28
28
|
# from pygeodesy.streprs import pairs # from .named
|
|
@@ -30,7 +30,7 @@ from pygeodesy.props import Property, Property_RO, property_RO
|
|
|
30
30
|
from math import fmod as _fmod
|
|
31
31
|
|
|
32
32
|
__all__ = ()
|
|
33
|
-
__version__ = '24.05.
|
|
33
|
+
__version__ = '24.05.19'
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class GeodesicAreaExact(_NamedBase):
|
|
@@ -55,14 +55,14 @@ class GeodesicAreaExact(_NamedBase):
|
|
|
55
55
|
_verbose = False
|
|
56
56
|
_xings = 0
|
|
57
57
|
|
|
58
|
-
def __init__(self, geodesic, polyline=False, name
|
|
58
|
+
def __init__(self, geodesic, polyline=False, **name):
|
|
59
59
|
'''New L{GeodesicAreaExact} instance.
|
|
60
60
|
|
|
61
61
|
@arg geodesic: A geodesic (L{GeodesicExact}, I{wrapped}
|
|
62
62
|
C{Geodesic} or L{GeodesicSolve}).
|
|
63
63
|
@kwarg polyline: If C{True}, compute the perimeter only,
|
|
64
64
|
otherwise area and perimeter (C{bool}).
|
|
65
|
-
@kwarg name: Optional name (C{str}).
|
|
65
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
66
66
|
|
|
67
67
|
@raise GeodesicError: Invalid B{C{geodesic}}.
|
|
68
68
|
'''
|
|
@@ -408,18 +408,18 @@ class GeodesicAreaExact(_NamedBase):
|
|
|
408
408
|
class PolygonArea(GeodesicAreaExact):
|
|
409
409
|
'''For C{geographiclib} compatibility, sub-class of L{GeodesicAreaExact}.
|
|
410
410
|
'''
|
|
411
|
-
def __init__(self, earth, polyline=False, name
|
|
411
|
+
def __init__(self, earth, polyline=False, **name):
|
|
412
412
|
'''New L{PolygonArea} instance.
|
|
413
413
|
|
|
414
414
|
@arg earth: A geodesic (L{GeodesicExact}, I{wrapped}
|
|
415
415
|
C{Geodesic} or L{GeodesicSolve}).
|
|
416
416
|
@kwarg polyline: If C{True} perimeter only, otherwise
|
|
417
417
|
area and perimeter (C{bool}).
|
|
418
|
-
@kwarg name: Optional name (C{str}).
|
|
418
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
419
419
|
|
|
420
420
|
@raise GeodesicError: Invalid B{C{earth}}.
|
|
421
421
|
'''
|
|
422
|
-
GeodesicAreaExact.__init__(self, earth, polyline=polyline, name
|
|
422
|
+
GeodesicAreaExact.__init__(self, earth, polyline=polyline, **name)
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
class _Accumulator(_NamedBase):
|
|
@@ -432,8 +432,11 @@ class _Accumulator(_NamedBase):
|
|
|
432
432
|
_n = 0 # len()
|
|
433
433
|
_s = _t = _0_0
|
|
434
434
|
|
|
435
|
-
def __init__(self, y=0, name
|
|
435
|
+
def __init__(self, y=0, **name):
|
|
436
436
|
'''New L{_Accumulator}.
|
|
437
|
+
|
|
438
|
+
@kwarg y: Initial value (C{scalar}).
|
|
439
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
437
440
|
'''
|
|
438
441
|
if isinstance(y, _Accumulator):
|
|
439
442
|
self._s, self._t, self._n = y._s, y._t, 1
|
pygeodesy/geodesicx/gxbases.py
CHANGED
|
@@ -10,16 +10,15 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
|
|
|
10
10
|
|
|
11
11
|
from pygeodesy.basics import isodd, _MODS
|
|
12
12
|
from pygeodesy.constants import _0_0, _100_0
|
|
13
|
-
from pygeodesy.errors import _or, _xkwds_item2
|
|
13
|
+
from pygeodesy.errors import _or, _xkwds_item2
|
|
14
14
|
from pygeodesy.fmath import hypot as _hypot
|
|
15
|
-
# from pygeodesy.interns import _not_ # from .errors
|
|
16
15
|
from pygeodesy.karney import _CapsBase, GeodesicError, _2cos2x, _sum2_
|
|
17
16
|
# from pygeodesy.lazily import _MODS, printf # .basics, _MODS
|
|
18
17
|
|
|
19
18
|
from math import ldexp as _ldexp
|
|
20
19
|
|
|
21
20
|
__all__ = ()
|
|
22
|
-
__version__ = '24.
|
|
21
|
+
__version__ = '24.05.19'
|
|
23
22
|
|
|
24
23
|
# valid C{nC4}s and C{C4order}s, see _xnC4 below
|
|
25
24
|
_nC4s = {24: 2900, 27: 4032, 30: 5425}
|
|
@@ -127,7 +126,7 @@ def _xnC4(**name_nC4):
|
|
|
127
126
|
'''
|
|
128
127
|
n, nC4 = _xkwds_item2(name_nC4)
|
|
129
128
|
if nC4 not in _nC4s or not isinstance(nC4, int):
|
|
130
|
-
raise GeodesicError(n, nC4,
|
|
129
|
+
raise GeodesicError(n, nC4, txt_not_=_or(*map(str, _nC4s)))
|
|
131
130
|
return _nC4s[nC4]
|
|
132
131
|
|
|
133
132
|
|
pygeodesy/geodesicx/gxline.py
CHANGED
|
@@ -39,12 +39,12 @@ from __future__ import division as _; del _ # PYCHOK semicolon
|
|
|
39
39
|
# from pygeodesy.basics import _xinstanceof # _MODS
|
|
40
40
|
from pygeodesy.constants import NAN, _EPSmin, _EPSqrt as _TOL, _0_0, \
|
|
41
41
|
_1_0, _180_0, _2__PI, _copysign_1_0
|
|
42
|
-
from pygeodesy.errors import _xError,
|
|
42
|
+
from pygeodesy.errors import _xError, _COMMASPACE_
|
|
43
43
|
from pygeodesy.fsums import fsumf_, fsum1f_
|
|
44
44
|
from pygeodesy.geodesicx.gxbases import _cosSeries, _GeodesicBase, \
|
|
45
45
|
_sincos12, _sin1cos2
|
|
46
46
|
# from pygeodesy.geodesicw import _Intersecant2 # _MODS
|
|
47
|
-
from pygeodesy.interns import
|
|
47
|
+
# from pygeodesy.interns import _COMMASPACE_ # from .errors
|
|
48
48
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS
|
|
49
49
|
from pygeodesy.karney import _around, _atan2d, Caps, GDict, _fix90, \
|
|
50
50
|
_K_2_0, _norm2, _norm180, _sincos2, _sincos2d
|
|
@@ -55,7 +55,7 @@ from pygeodesy.utily import atan2d as _atan2d_reverse, sincos2
|
|
|
55
55
|
from math import atan2, cos, degrees, fabs, floor, radians, sin
|
|
56
56
|
|
|
57
57
|
__all__ = ()
|
|
58
|
-
__version__ = '24.
|
|
58
|
+
__version__ = '24.05.19'
|
|
59
59
|
|
|
60
60
|
_glXs = [] # instances of C{[_]GeodesicLineExact} to be updated
|
|
61
61
|
# underflow guard, we require _TINY * EPS > 0, _TINY + EPS == EPS
|
|
@@ -95,7 +95,7 @@ class _GeodesicLineExact(_GeodesicBase):
|
|
|
95
95
|
# _somg1 = _comg1 = NAN
|
|
96
96
|
# _ssig1 = _csig1 = NAN
|
|
97
97
|
|
|
98
|
-
def __init__(self, gX, lat1, lon1, azi1, caps, _debug, *salp1_calp1, **name):
|
|
98
|
+
def __init__(self, gX, lat1, lon1, azi1, caps, _debug, *salp1_calp1, **name):
|
|
99
99
|
'''(INTERNAL) New C{[_]GeodesicLineExact} instance.
|
|
100
100
|
'''
|
|
101
101
|
_xGeodesicExact(gX=gX)
|
|
@@ -110,10 +110,8 @@ class _GeodesicLineExact(_GeodesicBase):
|
|
|
110
110
|
# guard against salp0 underflow,
|
|
111
111
|
# also -0 is converted to +0
|
|
112
112
|
salp1, calp1 = _sincos2d(_around(azi1))
|
|
113
|
-
if name:
|
|
114
|
-
name =
|
|
115
|
-
if name:
|
|
116
|
-
self.name = name
|
|
113
|
+
if name:
|
|
114
|
+
self.name = name
|
|
117
115
|
|
|
118
116
|
self._gX = gX # GeodesicExact only
|
|
119
117
|
self._lat1 = lat1 = _fix90(lat1)
|
pygeodesy/geodsolve.py
CHANGED
|
@@ -10,24 +10,23 @@ of the C{GeodSolve} executable.
|
|
|
10
10
|
'''
|
|
11
11
|
|
|
12
12
|
from pygeodesy.basics import _xinstanceof
|
|
13
|
-
# from pygeodesy.errors import _xkwds # from .karney
|
|
14
13
|
# from pygeodesy.geodesicx import GeodesicAreaExact # _MODS
|
|
15
|
-
# from pygeodesy.internals import printf # from .lazily
|
|
16
14
|
from pygeodesy.interns import NN, _a12_, _azi1_, _azi2_, \
|
|
17
15
|
_lat1_, _lat2_, _lon1_, _lon2_, _m12_, \
|
|
18
16
|
_M12_, _M21_, _s12_, _S12_, _UNDER_
|
|
19
17
|
from pygeodesy.interns import _UNUSED_, _not_ # PYCHOK used!
|
|
20
18
|
from pygeodesy.karney import _Azi, Caps, _Deg, GeodesicError, _GTuple, \
|
|
21
|
-
_Pass, _Lat, _Lon, _M, _M2, _sincos2d
|
|
19
|
+
_Pass, _Lat, _Lon, _M, _M2, _sincos2d
|
|
22
20
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, \
|
|
23
|
-
_getenv, _PYGEODESY_GEODSOLVE_
|
|
21
|
+
_getenv, _PYGEODESY_GEODSOLVE_
|
|
22
|
+
from pygeodesy.named import _name1__
|
|
24
23
|
from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple
|
|
25
24
|
from pygeodesy.props import Property, Property_RO
|
|
26
25
|
from pygeodesy.solveBase import _SolveBase, _SolveLineBase
|
|
27
26
|
from pygeodesy.utily import _unrollon, _Wrap, wrap360
|
|
28
27
|
|
|
29
28
|
__all__ = _ALL_LAZY.geodsolve
|
|
30
|
-
__version__ = '24.05.
|
|
29
|
+
__version__ = '24.05.31'
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
class GeodSolve12Tuple(_GTuple):
|
|
@@ -117,21 +116,20 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
117
116
|
executable for I{every} method call.
|
|
118
117
|
'''
|
|
119
118
|
|
|
120
|
-
def Area(self, polyline=False, name
|
|
119
|
+
def Area(self, polyline=False, **name):
|
|
121
120
|
'''Set up a L{GeodesicAreaExact} to compute area and
|
|
122
121
|
perimeter of a polygon.
|
|
123
122
|
|
|
124
123
|
@kwarg polyline: If C{True} perimeter only, otherwise
|
|
125
124
|
area and perimeter (C{bool}).
|
|
126
|
-
@kwarg name: Optional name (C{str}).
|
|
125
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
127
126
|
|
|
128
127
|
@return: A L{GeodesicAreaExact} instance.
|
|
129
128
|
|
|
130
129
|
@note: The B{C{debug}} setting is passed as C{verbose}
|
|
131
130
|
to the returned L{GeodesicAreaExact} instance.
|
|
132
131
|
'''
|
|
133
|
-
gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline,
|
|
134
|
-
name=name or self.name)
|
|
132
|
+
gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline, **name)
|
|
135
133
|
if self.verbose or self.debug: # PYCHOK no cover
|
|
136
134
|
gaX.verbose = True
|
|
137
135
|
return gaX
|
|
@@ -160,9 +158,10 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
160
158
|
@arg lat1: Latitude of the first point (C{degrees}).
|
|
161
159
|
@arg lon1: Longitude of the first point (C{degrees}).
|
|
162
160
|
@arg azi1: Azimuth at the first point (compass C{degrees}).
|
|
163
|
-
@kwarg caps_name:
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
@kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword
|
|
162
|
+
argument C{B{caps}=Caps.ALL}, bit-or'ed combination
|
|
163
|
+
of L{Caps} values specifying the capabilities the
|
|
164
|
+
L{GeodesicLineSolve} instance should possess.
|
|
166
165
|
|
|
167
166
|
@return: A L{GeodesicLineSolve} instance.
|
|
168
167
|
|
|
@@ -174,7 +173,7 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
174
173
|
<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>}
|
|
175
174
|
and Python U{Geodesic.Line<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
|
|
176
175
|
'''
|
|
177
|
-
return GeodesicLineSolve(self, lat1, lon1, azi1, **
|
|
176
|
+
return GeodesicLineSolve(self, lat1, lon1, azi1, **_name1__(caps_name, _or_nameof=self))
|
|
178
177
|
|
|
179
178
|
Line = DirectLine
|
|
180
179
|
|
|
@@ -210,9 +209,10 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
210
209
|
@arg lon1: Longitude of the first point (C{degrees}).
|
|
211
210
|
@arg lat2: Latitude of the second point (C{degrees}).
|
|
212
211
|
@arg lon2: Longitude of the second point (C{degrees}).
|
|
213
|
-
@kwarg caps_name:
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
@kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword
|
|
213
|
+
argument C{B{caps}=Caps.ALL}, bit-or'ed combination
|
|
214
|
+
of L{Caps} values specifying the capabilities the
|
|
215
|
+
L{GeodesicLineSolve} instance should possess.
|
|
216
216
|
|
|
217
217
|
@return: A L{GeodesicLineSolve} instance.
|
|
218
218
|
|
|
@@ -223,7 +223,7 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
223
223
|
Python U{Geodesic.InverseLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
|
|
224
224
|
'''
|
|
225
225
|
r = self.Inverse(lat1, lon1, lat2, lon2)
|
|
226
|
-
return GeodesicLineSolve(self, lat1, lon1, r.azi1, **
|
|
226
|
+
return GeodesicLineSolve(self, lat1, lon1, r.azi1, **_name1__(caps_name, _or_nameof=self))
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
|
|
@@ -238,7 +238,7 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
|
|
|
238
238
|
executable for I{every} method call.
|
|
239
239
|
'''
|
|
240
240
|
|
|
241
|
-
def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.ALL, name
|
|
241
|
+
def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.ALL, **name):
|
|
242
242
|
'''New L{GeodesicLineSolve} instance, allowing points to be found along
|
|
243
243
|
a geodesic starting at C{(B{lat1}, B{lon1})} with azimuth B{C{azi1}}.
|
|
244
244
|
|
|
@@ -246,14 +246,14 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
|
|
|
246
246
|
@arg lat1: Latitude of the first point (C{degrees}).
|
|
247
247
|
@arg lon1: Longitude of the first point (C{degrees}).
|
|
248
248
|
@arg azi1: Azimuth at the first points (compass C{degrees}).
|
|
249
|
-
@kwarg caps: Bit-or'ed combination of L{Caps} values specifying
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
@kwarg name: Optional name (C{str}).
|
|
255
|
-
|
|
256
|
-
@raise GeodesicError: Invalid path for the C{GeodSolve} executable
|
|
249
|
+
@kwarg caps: Bit-or'ed combination of L{Caps} values specifying the
|
|
250
|
+
capabilities the L{GeodesicLineSolve} instance should possess,
|
|
251
|
+
C{B{caps}=Caps.ALL} always. Include C{Caps.LINE_OFF} if
|
|
252
|
+
updates to the B{C{geodesic}} should I{not} be reflected in
|
|
253
|
+
this L{GeodesicLineSolve} instance.
|
|
254
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
255
|
+
|
|
256
|
+
@raise GeodesicError: Invalid path for the C{GeodSolve} executable
|
|
257
257
|
or isn't the C{GeodSolve} executable, see
|
|
258
258
|
property C{geodesic.GeodSolve}.
|
|
259
259
|
|
|
@@ -261,8 +261,8 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
|
|
|
261
261
|
'''
|
|
262
262
|
_xinstanceof(GeodesicSolve, geodesic=geodesic)
|
|
263
263
|
if (caps & Caps.LINE_OFF): # copy to avoid updates
|
|
264
|
-
geodesic = geodesic.copy(deep=False, name=NN
|
|
265
|
-
_SolveLineBase.__init__(self, geodesic, lat1, lon1, caps,
|
|
264
|
+
geodesic = geodesic.copy(deep=False, name=_UNDER_(NN, geodesic.name)) # NOT _under!
|
|
265
|
+
_SolveLineBase.__init__(self, geodesic, lat1, lon1, caps, azi1=azi1, **name)
|
|
266
266
|
try:
|
|
267
267
|
self.GeodSolve = geodesic.GeodSolve # geodesic or copy of geodesic
|
|
268
268
|
except GeodesicError:
|
|
@@ -338,6 +338,7 @@ __all__ += _ALL_DOCS(_GeodesicSolveBase)
|
|
|
338
338
|
|
|
339
339
|
if __name__ == '__main__':
|
|
340
340
|
|
|
341
|
+
from pygeodesy import printf
|
|
341
342
|
from sys import argv
|
|
342
343
|
|
|
343
344
|
gS = GeodesicSolve(name='Test')
|