pygeodesy 24.6.1__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.1.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 +53 -66
- pygeodesy/cartesianBase.py +143 -155
- 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 +49 -55
- pygeodesy/elevations.py +4 -4
- pygeodesy/ellipsoidalBase.py +28 -70
- pygeodesy/ellipsoidalBaseDI.py +19 -23
- pygeodesy/ellipsoidalExact.py +3 -3
- pygeodesy/ellipsoidalGeodSolve.py +15 -23
- pygeodesy/ellipsoidalKarney.py +37 -60
- pygeodesy/ellipsoidalNvector.py +44 -50
- pygeodesy/ellipsoidalVincenty.py +11 -14
- pygeodesy/ellipsoids.py +107 -101
- pygeodesy/errors.py +101 -49
- pygeodesy/etm.py +32 -44
- pygeodesy/formy.py +55 -58
- pygeodesy/frechet.py +20 -23
- pygeodesy/fsums.py +4 -4
- 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 +102 -34
- pygeodesy/geohash.py +39 -60
- pygeodesy/geoids.py +28 -37
- pygeodesy/hausdorff.py +21 -23
- pygeodesy/heights.py +15 -28
- pygeodesy/internals.py +19 -12
- pygeodesy/interns.py +4 -10
- pygeodesy/iters.py +2 -2
- pygeodesy/karney.py +20 -4
- pygeodesy/ktm.py +13 -16
- pygeodesy/latlonBase.py +202 -191
- pygeodesy/lazily.py +96 -59
- pygeodesy/lcc.py +29 -32
- pygeodesy/ltp.py +43 -24
- pygeodesy/ltpTuples.py +190 -183
- pygeodesy/mgrs.py +35 -9
- pygeodesy/named.py +106 -72
- pygeodesy/namedTuples.py +43 -14
- pygeodesy/nvectorBase.py +23 -27
- pygeodesy/osgr.py +9 -9
- pygeodesy/points.py +7 -7
- 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/rhumb/solve.py +8 -61
- pygeodesy/solveBase.py +22 -19
- pygeodesy/sphericalBase.py +26 -21
- pygeodesy/sphericalNvector.py +13 -13
- pygeodesy/sphericalTrigonometry.py +86 -97
- pygeodesy/streprs.py +8 -36
- pygeodesy/trf.py +3 -3
- pygeodesy/triaxials.py +117 -91
- pygeodesy/units.py +229 -321
- pygeodesy/unitsBase.py +116 -108
- pygeodesy/ups.py +26 -31
- pygeodesy/utily.py +12 -11
- pygeodesy/utm.py +35 -40
- pygeodesy/utmups.py +43 -46
- pygeodesy/utmupsBase.py +9 -10
- pygeodesy/vector3d.py +59 -62
- pygeodesy/vector3dBase.py +17 -15
- pygeodesy/webmercator.py +19 -21
- pygeodesy/wgrs.py +18 -20
- PyGeodesy-24.6.1.dist-info/RECORD +0 -116
- {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
pygeodesy/basics.py
CHANGED
|
@@ -30,13 +30,14 @@ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _FOR_DOCS, _getenv,
|
|
|
30
30
|
# from pygeodesy.nvectorBase import NvectorBase # _MODS
|
|
31
31
|
# from pygeodesy.props import _update_all # _MODS
|
|
32
32
|
# from pygeodesy.streprs import Fmt # _MODS
|
|
33
|
+
# from pygeodesy.unitsBase import _NamedUnit, Str # _MODS
|
|
33
34
|
|
|
34
35
|
from copy import copy as _copy, deepcopy as _deepcopy
|
|
35
36
|
from math import copysign as _copysign
|
|
36
37
|
import inspect as _inspect
|
|
37
38
|
|
|
38
39
|
__all__ = _ALL_LAZY.basics
|
|
39
|
-
__version__ = '24.
|
|
40
|
+
__version__ = '24.06.15'
|
|
40
41
|
|
|
41
42
|
_below_ = 'below'
|
|
42
43
|
_list_tuple_types = (list, tuple)
|
|
@@ -194,6 +195,13 @@ def copytype(x, y):
|
|
|
194
195
|
return type(y)(x if x else _0_0)
|
|
195
196
|
|
|
196
197
|
|
|
198
|
+
def _enumereverse(iterable):
|
|
199
|
+
'''(INTERNAL) Reversed C{enumberate}.
|
|
200
|
+
'''
|
|
201
|
+
for j in _reverange(len(iterable)):
|
|
202
|
+
yield j, iterable[j]
|
|
203
|
+
|
|
204
|
+
|
|
197
205
|
def halfs2(str2):
|
|
198
206
|
'''Split a string in 2 halfs.
|
|
199
207
|
|
pygeodesy/booleans.py
CHANGED
|
@@ -20,7 +20,7 @@ from __future__ import division as _; del _ # PYCHOK semicolon
|
|
|
20
20
|
from pygeodesy.basics import isodd, issubclassof, map2, _xscalar
|
|
21
21
|
from pygeodesy.constants import EPS, EPS2, INT0, _0_0, _0_5, _1_0
|
|
22
22
|
from pygeodesy.errors import ClipError, _IsnotError, _TypeError, \
|
|
23
|
-
_ValueError, _xattr, _xkwds_get
|
|
23
|
+
_ValueError, _xattr, _xkwds_get, _xkwds_pop2
|
|
24
24
|
from pygeodesy.fmath import favg, hypot, hypot2
|
|
25
25
|
# from pygeodesy.fsums import fsum1 # _MODS
|
|
26
26
|
from pygeodesy.interns import NN, _BANG_, _clip_, _clipid_, _COMMASPACE_, \
|
|
@@ -43,7 +43,7 @@ from pygeodesy.utily import fabs, _unrollon, _Wrap
|
|
|
43
43
|
# from math import fabs # from .utily
|
|
44
44
|
|
|
45
45
|
__all__ = _ALL_LAZY.booleans
|
|
46
|
-
__version__ = '24.
|
|
46
|
+
__version__ = '24.06.15'
|
|
47
47
|
|
|
48
48
|
_0_EPS = EPS # near-zero, positive
|
|
49
49
|
_EPS_0 = -EPS # near-zero, negative
|
|
@@ -124,30 +124,28 @@ class _LatLonBool(_Named):
|
|
|
124
124
|
_next = None # link to the next vertex
|
|
125
125
|
_prev = None # link to the previous vertex
|
|
126
126
|
|
|
127
|
-
def __init__(self, lat_ll, lon=None, height=0, clipid=INT0,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
@kwarg lon: Longitude (C{scalar}), iff B{C{lat_ll}} is
|
|
137
|
-
scalar, ignored otherwise.
|
|
127
|
+
def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, wrap=False, **name):
|
|
128
|
+
'''New C{LatLon[FHP|GH]} from separate C{lat}, C{lon}, C{height} and C{clipid}
|
|
129
|
+
scalars or from a previous C{LatLon[FHP|GH]}, C{Clip[FHP|GH]4Tuple} or some
|
|
130
|
+
other C{LatLon} instance.
|
|
131
|
+
|
|
132
|
+
@arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (C{LatLon[FHP|GH]},
|
|
133
|
+
C{Clip[FHP|GH]4Tuple} or some other C{LatLon}).
|
|
134
|
+
@kwarg lon: Longitude (C{scalar}), required B{C{lat_ll}} is scalar,
|
|
135
|
+
ignored otherwise.
|
|
138
136
|
@kwarg height: Height (C{scalar}), conventionally C{meter}.
|
|
139
137
|
@kwarg clipid: Clip identifier (C{int}).
|
|
140
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}}
|
|
141
|
-
|
|
142
|
-
@kwarg name: Optional name (C{str}).
|
|
138
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}} and B{C{lon}} (C{bool}).
|
|
139
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
143
140
|
'''
|
|
141
|
+
h, name = _xkwds_pop2(name, h=height) if name else (height, name)
|
|
142
|
+
|
|
144
143
|
if lon is None:
|
|
145
144
|
y, x = lat_ll.lat, lat_ll.lon
|
|
146
|
-
h = _xattr(lat_ll, height=
|
|
145
|
+
h = _xattr(lat_ll, height=h)
|
|
147
146
|
c = _xattr(lat_ll, clipid=clipid)
|
|
148
147
|
else:
|
|
149
|
-
y, x = lat_ll, lon
|
|
150
|
-
h, c = height, clipid
|
|
148
|
+
y, x, c = lat_ll, lon, clipid
|
|
151
149
|
self.y, self.x = _Wrap.latlon(y, x) if wrap else (y, x)
|
|
152
150
|
# don't duplicate defaults
|
|
153
151
|
if self._height != h:
|
|
@@ -301,22 +299,17 @@ class LatLonFHP(_LatLonBool):
|
|
|
301
299
|
_2split = None # or C{._Clip}
|
|
302
300
|
_2xing = False
|
|
303
301
|
|
|
304
|
-
def __init__(self, lat_ll,
|
|
305
|
-
'''New C{LatLonFHP} from separate C{lat}, C{lon}, C{h}eight
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
@arg lat_ll: Latitude (C{scalar}) or a lat
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
C{B{name}=NN}. If C{B{wrap} is True}, wrap
|
|
316
|
-
or I{normalize} the lat- and longitude
|
|
317
|
-
(C{bool}). Optional B{C{name}} (C{str}).
|
|
318
|
-
'''
|
|
319
|
-
_LatLonBool.__init__(self, lat_ll, *lon_h_clipid, **wrap_name)
|
|
302
|
+
def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, **wrap_name):
|
|
303
|
+
'''New C{LatLonFHP} from separate C{lat}, C{lon}, C{h}eight and C{clipid}
|
|
304
|
+
scalars, or from a previous L{LatLonFHP}, L{ClipFHP4Tuple} or some other
|
|
305
|
+
C{LatLon} instance.
|
|
306
|
+
|
|
307
|
+
@arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (L{LatLonFHP},
|
|
308
|
+
L{ClipFHP4Tuple} or some other C{LatLon}).
|
|
309
|
+
|
|
310
|
+
@see: L{Here<_LatLonBool.__init__>} for further details.
|
|
311
|
+
'''
|
|
312
|
+
_LatLonBool.__init__(self, lat_ll, lon, height, clipid, **wrap_name)
|
|
320
313
|
|
|
321
314
|
def __add__(self, other):
|
|
322
315
|
_other(self, other)
|
|
@@ -364,15 +357,15 @@ class LatLonFHP(_LatLonBool):
|
|
|
364
357
|
# return d
|
|
365
358
|
|
|
366
359
|
def isenclosedBy(self, *composites_points, **wrap):
|
|
367
|
-
'''Is this point inside one or more composites or polygons based
|
|
368
|
-
the U{winding number<https://www.ScienceDirect.com/science/
|
|
369
|
-
|
|
360
|
+
'''Is this point inside one or more composites or polygons based on
|
|
361
|
+
the U{winding number<https://www.ScienceDirect.com/science/article/
|
|
362
|
+
pii/S0925772101000128>}?
|
|
370
363
|
|
|
371
364
|
@arg composites_points: Composites and/or iterables of points
|
|
372
365
|
(L{ClipFHP4Tuple}, L{ClipGH4Tuple}, L{LatLonFHP},
|
|
373
366
|
L{LatLonGH} or any C{LatLon}).
|
|
374
|
-
@kwarg wrap:
|
|
375
|
-
C{points} (C{bool}).
|
|
367
|
+
@kwarg wrap: Optional keyword argument C{B{wrap}=False}, if C{True},
|
|
368
|
+
wrap or I{normalize} and unroll all C{points} (C{bool}).
|
|
376
369
|
|
|
377
370
|
@raise ValueError: Some C{points} invalid.
|
|
378
371
|
|
|
@@ -462,22 +455,17 @@ class LatLonGH(_LatLonBool):
|
|
|
462
455
|
'''
|
|
463
456
|
_entry = None # entry or exit iff intersection
|
|
464
457
|
|
|
465
|
-
def __init__(self, lat_ll,
|
|
466
|
-
'''New C{LatLonGH} from separate C{lat}, C{lon}, C{h}eight
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
@arg lat_ll: Latitude (C{scalar}) or a lat
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
ignored otherwise.
|
|
475
|
-
@kwarg wrap_name: Keyword arguments C{B{wrap}=False} and
|
|
476
|
-
C{B{name}=NN}. If C{B{wrap} is True}, wrap
|
|
477
|
-
or I{normalize} the lat- and longitude
|
|
478
|
-
(C{bool}). Optional B{C{name}} (C{str}).
|
|
458
|
+
def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, **wrap_name):
|
|
459
|
+
'''New C{LatLonGH} from separate C{lat}, C{lon}, C{h}eight and C{clipid}
|
|
460
|
+
scalars, or from a previous L{LatLonGH}, L{ClipGH4Tuple} or some other
|
|
461
|
+
C{LatLon} instance.
|
|
462
|
+
|
|
463
|
+
@arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (L{LatLonGH},
|
|
464
|
+
L{ClipGH4Tuple} or some other C{LatLon}).
|
|
465
|
+
|
|
466
|
+
@see: L{Here<_LatLonBool.__init__>} for further details.
|
|
479
467
|
'''
|
|
480
|
-
_LatLonBool.__init__(self, lat_ll,
|
|
468
|
+
_LatLonBool.__init__(self, lat_ll, lon, height, clipid, **wrap_name)
|
|
481
469
|
|
|
482
470
|
def _check(self):
|
|
483
471
|
# Check-mark this vertex and its link.
|
|
@@ -498,8 +486,8 @@ class LatLonGH(_LatLonBool):
|
|
|
498
486
|
@arg composites_points: Composites and/or iterables of points
|
|
499
487
|
(L{ClipFHP4Tuple}, L{ClipGH4Tuple}, L{LatLonFHP},
|
|
500
488
|
L{LatLonGH} or any C{LatLon}).
|
|
501
|
-
@kwarg wrap:
|
|
502
|
-
C{points} (C{bool}).
|
|
489
|
+
@kwarg wrap: Optional keyword argument C{B{wrap}=False}, if C{True},
|
|
490
|
+
wrap or I{normalize} and unroll all C{points} (C{bool}).
|
|
503
491
|
|
|
504
492
|
@raise ValueError: Some B{C{points}} invalid.
|
|
505
493
|
'''
|
|
@@ -667,7 +655,7 @@ class _Clip(_Named):
|
|
|
667
655
|
return map2(float, _MODS.points.boundsOf(self, wrap=False))
|
|
668
656
|
|
|
669
657
|
def _bltr4eps(self, eps):
|
|
670
|
-
# Get the ._bltr4 bounds tuple, oversized.
|
|
658
|
+
# Get the ._bltr4 bounds tuple, slightly oversized.
|
|
671
659
|
if eps > 0: # > EPS
|
|
672
660
|
yb, xl, yt, xr = self._bltr4
|
|
673
661
|
yb, yt = _low_high_eps2(yb, yt, eps)
|
|
@@ -806,8 +794,8 @@ class _Clip(_Named):
|
|
|
806
794
|
|
|
807
795
|
def _noXings(self, Union):
|
|
808
796
|
# Are all intersections non-CROSSINGs, -BOUNCINGs?
|
|
809
|
-
|
|
810
|
-
return all(v._label not in
|
|
797
|
+
Xings = _L.BOUNCINGs if Union else _L.CROSSINGs
|
|
798
|
+
return all(v._label not in Xings for v in self._intersections())
|
|
811
799
|
|
|
812
800
|
def _OpenClipError(self, s, e): # PYCHOK no cover
|
|
813
801
|
# Return a C{CloseError} instance
|
|
@@ -1810,7 +1798,7 @@ class BooleanFHP(_CompositeFHP, _BooleanBase):
|
|
|
1810
1798
|
@kwarg raiser: If C{True}, throw L{ClipError} exceptions (C{bool}).
|
|
1811
1799
|
@kwarg esp: Tolerance for eliminating null edges (C{degrees}, same
|
|
1812
1800
|
units as the B{C{lls}} coordinates).
|
|
1813
|
-
@kwarg name: Optional name (C{str}).
|
|
1801
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1814
1802
|
'''
|
|
1815
1803
|
_CompositeFHP.__init__(self, lls, raiser=raiser, eps=eps, **name)
|
|
1816
1804
|
|
|
@@ -1874,7 +1862,7 @@ class BooleanGH(_CompositeGH, _BooleanBase):
|
|
|
1874
1862
|
attempt to handle the latter (C{bool}).
|
|
1875
1863
|
@kwarg esp: Tolerance for eliminating null edges (C{degrees}, same
|
|
1876
1864
|
units as the B{C{lls}} coordinates).
|
|
1877
|
-
@kwarg name: Optional name (C{str}).
|
|
1865
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1878
1866
|
'''
|
|
1879
1867
|
_CompositeGH.__init__(self, lls, raiser=raiser, xtend=xtend, eps=eps, **name)
|
|
1880
1868
|
|
|
@@ -1937,9 +1925,8 @@ def isBoolean(obj):
|
|
|
1937
1925
|
|
|
1938
1926
|
@arg obj: The object (any C{type}).
|
|
1939
1927
|
|
|
1940
|
-
@return: C{True} if B{C{obj}} is L{BooleanFHP},
|
|
1941
|
-
|
|
1942
|
-
C{False} otherwise.
|
|
1928
|
+
@return: C{True} if B{C{obj}} is L{BooleanFHP}, L{BooleanGH}
|
|
1929
|
+
or some other composite, C{False} otherwise.
|
|
1943
1930
|
'''
|
|
1944
1931
|
return isinstance(obj, _CompositeBase)
|
|
1945
1932
|
|
|
@@ -1974,7 +1961,7 @@ def _other(this, other):
|
|
|
1974
1961
|
C = this.__class__
|
|
1975
1962
|
if isinstance(other, C):
|
|
1976
1963
|
return other
|
|
1977
|
-
raise _IsnotError(C
|
|
1964
|
+
raise _IsnotError(C, other=other)
|
|
1978
1965
|
|
|
1979
1966
|
|
|
1980
1967
|
def _outside(x1, x2, lo, hi):
|