pygeodesy 24.8.4__py2.py3-none-any.whl → 24.9.9__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.8.4.dist-info → PyGeodesy-24.9.9.dist-info}/METADATA +17 -16
- PyGeodesy-24.9.9.dist-info/RECORD +118 -0
- {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.9.9.dist-info}/WHEEL +1 -1
- pygeodesy/__init__.py +23 -23
- pygeodesy/__main__.py +46 -47
- pygeodesy/auxilats/_CX_4.py +104 -181
- pygeodesy/auxilats/_CX_6.py +152 -277
- pygeodesy/auxilats/_CX_8.py +211 -438
- pygeodesy/auxilats/_CX_Rs.py +222 -0
- pygeodesy/auxilats/__init__.py +2 -2
- pygeodesy/auxilats/__main__.py +30 -38
- pygeodesy/auxilats/auxDST.py +2 -2
- pygeodesy/auxilats/auxLat.py +28 -36
- pygeodesy/auxilats/auxily.py +30 -50
- pygeodesy/basics.py +18 -7
- pygeodesy/booleans.py +10 -11
- pygeodesy/cartesianBase.py +5 -5
- pygeodesy/constants.py +35 -34
- pygeodesy/ellipsoidalBase.py +18 -15
- pygeodesy/ellipsoidalExact.py +2 -2
- pygeodesy/ellipsoidalGeodSolve.py +2 -2
- pygeodesy/ellipsoidalKarney.py +2 -2
- pygeodesy/ellipsoidalNvector.py +2 -2
- pygeodesy/ellipsoidalVincenty.py +7 -6
- pygeodesy/elliptic.py +154 -88
- pygeodesy/epsg.py +3 -3
- pygeodesy/etm.py +71 -59
- pygeodesy/fmath.py +99 -90
- pygeodesy/fsums.py +201 -14
- pygeodesy/gars.py +9 -8
- pygeodesy/geodesici.py +6 -5
- pygeodesy/geodesicx/_C4_24.py +1 -3
- pygeodesy/geodesicx/_C4_27.py +1 -3
- pygeodesy/geodesicx/_C4_30.py +1 -3
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +44 -46
- pygeodesy/geodesicx/gx.py +3 -3
- pygeodesy/geodesicx/gxarea.py +5 -5
- pygeodesy/geodesicx/gxbases.py +32 -18
- pygeodesy/geodsolve.py +3 -3
- pygeodesy/geohash.py +18 -11
- pygeodesy/geoids.py +293 -315
- pygeodesy/heights.py +150 -158
- pygeodesy/internals.py +70 -9
- pygeodesy/interns.py +4 -4
- pygeodesy/karney.py +83 -60
- pygeodesy/ktm.py +4 -4
- pygeodesy/latlonBase.py +13 -7
- pygeodesy/lazily.py +13 -8
- pygeodesy/ltp.py +5 -6
- pygeodesy/ltpTuples.py +7 -1
- pygeodesy/mgrs.py +47 -42
- pygeodesy/named.py +8 -4
- pygeodesy/namedTuples.py +14 -1
- pygeodesy/osgr.py +7 -7
- pygeodesy/points.py +2 -2
- pygeodesy/props.py +7 -6
- pygeodesy/resections.py +7 -7
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +42 -60
- pygeodesy/rhumb/solve.py +3 -3
- pygeodesy/simplify.py +10 -10
- pygeodesy/sphericalBase.py +3 -3
- pygeodesy/sphericalTrigonometry.py +2 -2
- pygeodesy/streprs.py +3 -3
- pygeodesy/triaxials.py +207 -201
- pygeodesy/units.py +3 -3
- pygeodesy/unitsBase.py +4 -4
- pygeodesy/utmupsBase.py +3 -3
- pygeodesy/vector2d.py +158 -51
- pygeodesy/vector3d.py +13 -52
- pygeodesy/vector3dBase.py +81 -63
- pygeodesy/webmercator.py +3 -3
- pygeodesy/wgrs.py +20 -22
- PyGeodesy-24.8.4.dist-info/RECORD +0 -117
- {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.9.9.dist-info}/top_level.txt +0 -0
pygeodesy/geodesicx/gxbases.py
CHANGED
|
@@ -9,17 +9,18 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
|
|
|
9
9
|
'''
|
|
10
10
|
|
|
11
11
|
from pygeodesy.basics import isodd, _MODS
|
|
12
|
-
from pygeodesy.constants import _EPSmin as _TINY, _0_0
|
|
12
|
+
from pygeodesy.constants import _EPSmin as _TINY, _0_0
|
|
13
13
|
from pygeodesy.errors import _or, _xkwds_item2
|
|
14
14
|
from pygeodesy.fmath import hypot as _hypot
|
|
15
|
+
# from pygeodesy.interns import _numpy_ # _MODS
|
|
15
16
|
from pygeodesy.karney import _CapsBase, GeodesicError, _2cos2x, \
|
|
16
|
-
_norm2, _sincos2d,
|
|
17
|
-
# from pygeodesy.lazily import _MODS
|
|
17
|
+
_norm2, _sincos2d, _sum3
|
|
18
|
+
# from pygeodesy.lazily import _ALL_MODS as _MODS # from .basics
|
|
18
19
|
|
|
19
20
|
from math import fabs, ldexp as _ldexp
|
|
20
21
|
|
|
21
22
|
__all__ = ()
|
|
22
|
-
__version__ = '24.
|
|
23
|
+
__version__ = '24.09.07'
|
|
23
24
|
|
|
24
25
|
# valid C{nC4}s and C{C4order}s, see _xnC4 below
|
|
25
26
|
_nC4s = {24: 2900, 27: 4032, 30: 5425}
|
|
@@ -44,7 +45,7 @@ class _GeodesicBase(_CapsBase): # in .geodsolve
|
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
class _Gfloats(dict):
|
|
47
|
-
'''(INTERNAL)
|
|
48
|
+
'''(INTERNAL) Numpy or "Unique" floats.
|
|
48
49
|
'''
|
|
49
50
|
n = 0 # total number of floats
|
|
50
51
|
nC4 = 0
|
|
@@ -53,16 +54,16 @@ class _Gfloats(dict):
|
|
|
53
54
|
self.nC4 = nC4
|
|
54
55
|
|
|
55
56
|
def __call__(self, fs):
|
|
56
|
-
'''Return a tuple of
|
|
57
|
+
'''Return a C{numpy.array} or C{tuple} of C{float}s.
|
|
57
58
|
'''
|
|
59
|
+
np = _MODS.imported(_MODS.interns._numpy_)
|
|
60
|
+
if np: # use numpy, already imported
|
|
61
|
+
cs = np.array(fs, dtype=float)
|
|
62
|
+
else:
|
|
63
|
+
_f = self.setdefault # avoid duplicates
|
|
64
|
+
cs = tuple(_f(f, f) for f in map(float, fs)) # PYCHOK as attr
|
|
58
65
|
self.n += len(fs)
|
|
59
|
-
|
|
60
|
-
return tuple(_f(f, f) for f in map(float, fs)) # PYCHOK as attr
|
|
61
|
-
|
|
62
|
-
def prints(self):
|
|
63
|
-
n, u = self.n, len(self.keys())
|
|
64
|
-
d = (n - u) * _100_0 / n
|
|
65
|
-
_MODS.lazily.printf('_CX_%d: n=%d, u=%d, d=%.1f%%', self.nC4, n, u, d) # XXX
|
|
66
|
+
return cs
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
def _cosSeries(c4s, sx, cx): # PYCHOK shared .geodesicx.gx and -.gxline
|
|
@@ -75,15 +76,28 @@ def _cosSeries(c4s, sx, cx): # PYCHOK shared .geodesicx.gx and -.gxline
|
|
|
75
76
|
_c4 = c4.pop
|
|
76
77
|
if isodd(len(c4)):
|
|
77
78
|
y0 = _c4()
|
|
78
|
-
_s2 = _sum2_
|
|
79
79
|
while c4:
|
|
80
80
|
# y1 = ar * y0 - y1 + c4.pop()
|
|
81
81
|
# y0 = ar * y1 - y0 + c4.pop()
|
|
82
|
-
y1, t1 =
|
|
83
|
-
y0, t0 =
|
|
82
|
+
y1, t1, _ = _sum3(-y1, -t1, ar * y0, ar * t0, _c4())
|
|
83
|
+
y0, t0, _ = _sum3(-y0, -t0, ar * y1, ar * t1, _c4())
|
|
84
84
|
# s = (y0 - y1) * cx
|
|
85
|
-
s, _ =
|
|
86
|
-
return s
|
|
85
|
+
s, t, _ = _sum3(cx * y0, _0_0, cx * t0, -cx * y1, -cx * t1)
|
|
86
|
+
return s + t
|
|
87
|
+
|
|
88
|
+
# Y0, Y1 = Fsum(), Fsum()
|
|
89
|
+
# ar = _2cos2x(cx, sx)
|
|
90
|
+
# c4 = list(c4s)
|
|
91
|
+
# _c4 = c4.pop
|
|
92
|
+
# if isodd(len(c4)):
|
|
93
|
+
# Y0 += _c4()
|
|
94
|
+
# while c4:
|
|
95
|
+
# # y1 = ar * y0 - y1 + c4.pop()
|
|
96
|
+
# # y0 = ar * y1 - y0 + c4.pop()
|
|
97
|
+
# Y1 = Y0 * ar - Y1 + _c4()
|
|
98
|
+
# Y0 = Y1 * ar - Y0 + _c4()
|
|
99
|
+
# # s = (y0 - y1) * cx
|
|
100
|
+
# return float((Y0 - Y1) * cx)
|
|
87
101
|
|
|
88
102
|
|
|
89
103
|
_f = float # in _f2 and .geodesicx._C4_24, _27 and _30
|
pygeodesy/geodsolve.py
CHANGED
|
@@ -24,7 +24,7 @@ from pygeodesy.solveBase import _SolveGDictBase, _SolveGDictLineBase
|
|
|
24
24
|
from pygeodesy.utily import _unrollon, _Wrap, wrap360
|
|
25
25
|
|
|
26
26
|
__all__ = _ALL_LAZY.geodsolve
|
|
27
|
-
__version__ = '24.
|
|
27
|
+
__version__ = '24.08.13'
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class _GeodesicSolveBase(_SolveGDictBase):
|
|
@@ -101,8 +101,8 @@ class GeodesicSolve(_GeodesicSolveBase):
|
|
|
101
101
|
'''Set up a L{GeodesicAreaExact} to compute area and perimeter
|
|
102
102
|
of a polygon.
|
|
103
103
|
|
|
104
|
-
@kwarg polyline: If C{True} perimeter only, otherwise
|
|
105
|
-
and
|
|
104
|
+
@kwarg polyline: If C{True}, compute the perimeter only, otherwise
|
|
105
|
+
perimeter and area (C{bool}).
|
|
106
106
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
107
107
|
|
|
108
108
|
@return: A L{GeodesicAreaExact} instance.
|
pygeodesy/geohash.py
CHANGED
|
@@ -24,7 +24,7 @@ from pygeodesy.errors import _ValueError, _xkwds, _xStrError
|
|
|
24
24
|
# from pygeodesy import formy as _formy # _MODS
|
|
25
25
|
from pygeodesy.interns import NN, _COMMA_, _DOT_, _E_, _height_, _N_, _NE_, \
|
|
26
26
|
_NW_, _radius_, _S_, _SE_, _SPACE_, _SW_, _W_, \
|
|
27
|
-
_width_
|
|
27
|
+
_width_ # _INV_
|
|
28
28
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
|
|
29
29
|
from pygeodesy.named import _name__, _NamedDict, _NamedTuple, nameof, _xnamed
|
|
30
30
|
from pygeodesy.namedTuples import Bounds2Tuple, Bounds4Tuple, LatLon2Tuple, \
|
|
@@ -38,7 +38,7 @@ from pygeodesy.units import Degrees_, Int, Lat_, Lon_, Meter, Precision_, Str
|
|
|
38
38
|
from math import fabs, ldexp, log10, radians
|
|
39
39
|
|
|
40
40
|
__all__ = _ALL_LAZY.geohash
|
|
41
|
-
__version__ = '24.08.
|
|
41
|
+
__version__ = '24.08.05'
|
|
42
42
|
|
|
43
43
|
_formy = _MODS.into(formy=__name__)
|
|
44
44
|
_MASK5 = 16, 8, 4, 2, 1 # PYCHOK used!
|
|
@@ -118,8 +118,8 @@ def _2res(res, **prec):
|
|
|
118
118
|
'''(INTERNAL) Get the C{res}olution for a C{prec}ision.
|
|
119
119
|
'''
|
|
120
120
|
p = max(min(Int(Error=GeohashError, **prec), _MaxPrec), 0) * 5
|
|
121
|
-
|
|
122
|
-
return ldexp(res, -
|
|
121
|
+
x = (p - p // 2) if res > _180_0 else (p // 2)
|
|
122
|
+
return ldexp(res, -x) if x else res # ldexp == res / float(1 << x)
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
class _GH(object):
|
|
@@ -231,7 +231,7 @@ class _GH(object):
|
|
|
231
231
|
'''Decode C{geohash} into 4-tuple C{(s, w, n, e)}.
|
|
232
232
|
'''
|
|
233
233
|
nc = len(geohash) if isstr(geohash) else 0
|
|
234
|
-
if not (0 < nc <= _MaxPrec):
|
|
234
|
+
if not (0 < nc <= _MaxPrec): # or geohash.startswith(_INV_)
|
|
235
235
|
raise GeohashError(geohash=geohash, len=nc)
|
|
236
236
|
s, w, n, e = self.SWNE4
|
|
237
237
|
D, d, _mid = self.DecodeB32, True, _2mid
|
|
@@ -507,6 +507,13 @@ class Geohash(Str):
|
|
|
507
507
|
'''
|
|
508
508
|
return len(self)
|
|
509
509
|
|
|
510
|
+
@Property_RO
|
|
511
|
+
def resolution2(self):
|
|
512
|
+
'''Get the I{lon-} and I{latitudinal} resolution of this cell
|
|
513
|
+
in a L{Resolutions2Tuple}C{(res1, res2)}, both in C{degrees}.
|
|
514
|
+
'''
|
|
515
|
+
return resolution2(self.precision, self.precision)
|
|
516
|
+
|
|
510
517
|
@deprecated_property_RO
|
|
511
518
|
def sizes(self):
|
|
512
519
|
'''DEPRECATED on 2024.07.28, use property C{Geohash.sizes3}.'''
|
|
@@ -515,11 +522,11 @@ class Geohash(Str):
|
|
|
515
522
|
|
|
516
523
|
@Property_RO
|
|
517
524
|
def sizes3(self):
|
|
518
|
-
'''Get the lat-, longitudinal and radial size of this cell
|
|
519
|
-
a L{Sizes3Tuple}C{(height, width, radius)}, all C{meter}.
|
|
525
|
+
'''Get the lat-, longitudinal and radial size of this cell in
|
|
526
|
+
a L{Sizes3Tuple}C{(height, width, radius)}, all in C{meter}.
|
|
520
527
|
'''
|
|
521
528
|
z = _GH.Sizes
|
|
522
|
-
n = min(
|
|
529
|
+
n = min(max(self.precision, 1), len(z) - 1)
|
|
523
530
|
return Sizes3Tuple(z[n], name=self.name)
|
|
524
531
|
|
|
525
532
|
def toLatLon(self, LatLon=None, **LatLon_kwds):
|
|
@@ -650,7 +657,7 @@ class Geohashed(object):
|
|
|
650
657
|
def _ab2round(self, *ll):
|
|
651
658
|
'''(INTERNAL) Make encoded keys C{a, b}.
|
|
652
659
|
'''
|
|
653
|
-
return map(round, ll, self._nn)
|
|
660
|
+
return map(round, ll, self._nn) # strict=True
|
|
654
661
|
|
|
655
662
|
def clear(self):
|
|
656
663
|
'''Clear the C{en-} and C{decoded} cache.
|
|
@@ -1007,8 +1014,8 @@ def resolution2(prec1, prec2=None):
|
|
|
1007
1014
|
(C{int} 1..12).
|
|
1008
1015
|
|
|
1009
1016
|
@return: L{Resolutions2Tuple}C{(res1, res2)} with the
|
|
1010
|
-
(geographic) resolutions C{degrees}, where
|
|
1011
|
-
B{is} res1} if no B{C{prec2}} is given.
|
|
1017
|
+
(geographic) resolutions in C{degrees}, where
|
|
1018
|
+
C{res2 B{is} res1} if no B{C{prec2}} is given.
|
|
1012
1019
|
|
|
1013
1020
|
@raise GeohashError: Invalid B{C{prec1}} or B{C{prec2}}.
|
|
1014
1021
|
|