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/geoids.py
CHANGED
|
@@ -118,7 +118,7 @@ except ImportError: # Python 3+
|
|
|
118
118
|
from io import BytesIO as _BytesIO # PYCHOK expected
|
|
119
119
|
|
|
120
120
|
__all__ = _ALL_LAZY.geoids
|
|
121
|
-
__version__ = '24.06.
|
|
121
|
+
__version__ = '24.06.11'
|
|
122
122
|
|
|
123
123
|
_assert_ = 'assert'
|
|
124
124
|
_bHASH_ = b'#'
|
|
@@ -323,10 +323,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
323
323
|
@kwarg LatLon: Optional class to return the location and height
|
|
324
324
|
(C{LatLon}) or C{None}.
|
|
325
325
|
|
|
326
|
-
@return: If B{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
center grid location.
|
|
326
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
327
|
+
height)} otherwise a B{C{LatLon}} instance with the lat-,
|
|
328
|
+
longitude and geoid height of the center grid location.
|
|
330
329
|
'''
|
|
331
330
|
return self._llh3LL(self._center, LatLon)
|
|
332
331
|
|
|
@@ -437,10 +436,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
437
436
|
@kwarg LatLon: Optional class to return the location and height
|
|
438
437
|
(C{LatLon}) or C{None}.
|
|
439
438
|
|
|
440
|
-
@return: If B{
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
highest grid location.
|
|
439
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
440
|
+
height)} otherwise a B{C{LatLon}} instance with the lat-,
|
|
441
|
+
longitude and geoid height of the highest grid location.
|
|
444
442
|
'''
|
|
445
443
|
return self._llh3LL(self._highest, LatLon)
|
|
446
444
|
|
|
@@ -513,10 +511,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
513
511
|
@kwarg LatLon: Optional class to return the location
|
|
514
512
|
(C{LatLon}) and height or C{None}.
|
|
515
513
|
|
|
516
|
-
@return: If B{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
lower-left, SW grid corner.
|
|
514
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
|
|
515
|
+
otherwise a B{C{LatLon}} instance with the lat-, longitude and
|
|
516
|
+
geoid height of the lower-left, SW grid corner.
|
|
520
517
|
'''
|
|
521
518
|
return self._llh3LL(self._lowerleft, LatLon)
|
|
522
519
|
|
|
@@ -532,10 +529,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
532
529
|
@kwarg LatLon: Optional class to return the location and height
|
|
533
530
|
(C{LatLon}) or C{None}.
|
|
534
531
|
|
|
535
|
-
@return: If B{
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
lower-right, SE grid corner.
|
|
532
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
|
|
533
|
+
otherwise a B{C{LatLon}} instance with the lat-, longitude and
|
|
534
|
+
geoid height of the lower-right, SE grid corner.
|
|
539
535
|
'''
|
|
540
536
|
|
|
541
537
|
return self._llh3LL(self._loweright, LatLon)
|
|
@@ -554,10 +550,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
554
550
|
@kwarg LatLon: Optional class to return the location and height
|
|
555
551
|
(C{LatLon}) or C{None}.
|
|
556
552
|
|
|
557
|
-
@return: If B{
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
lowest grid location.
|
|
553
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
554
|
+
height)} otherwise a B{C{LatLon}} instance with the lat-,
|
|
555
|
+
longitude and geoid height of the lowest grid location.
|
|
561
556
|
'''
|
|
562
557
|
return self._llh3LL(self._lowest, LatLon)
|
|
563
558
|
|
|
@@ -701,10 +696,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
701
696
|
@kwarg LatLon: Optional class to return the location and height
|
|
702
697
|
(C{LatLon}) or C{None}.
|
|
703
698
|
|
|
704
|
-
@return: If B{
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
upper-left, NW grid corner.
|
|
699
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
|
|
700
|
+
otherwise a B{C{LatLon}} instance with the lat-, longitude and
|
|
701
|
+
geoid height of the upper-left, NW grid corner.
|
|
708
702
|
'''
|
|
709
703
|
return self._llh3LL(self._upperleft, LatLon)
|
|
710
704
|
|
|
@@ -720,10 +714,9 @@ class _GeoidBase(_HeightsBase):
|
|
|
720
714
|
@kwarg LatLon: Optional class to return the location and height
|
|
721
715
|
(C{LatLon}) or C{None}.
|
|
722
716
|
|
|
723
|
-
@return: If B{
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
upper-right, NE grid corner.
|
|
717
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
|
|
718
|
+
otherwise a B{C{LatLon}} instance with the lat-, longitude and
|
|
719
|
+
geoid height of the upper-right, NE grid corner.
|
|
727
720
|
'''
|
|
728
721
|
return self._llh3LL(self._upperright, LatLon)
|
|
729
722
|
|
|
@@ -1169,10 +1162,9 @@ class GeoidKarney(_GeoidBase):
|
|
|
1169
1162
|
(C{LatLon}) or C{None}.
|
|
1170
1163
|
@kwarg full: Search the full or limited latitude range (C{bool}).
|
|
1171
1164
|
|
|
1172
|
-
@return: If B{
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
highest grid location.
|
|
1165
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
1166
|
+
height)} otherwise a B{C{LatLon}} instance with the lat-,
|
|
1167
|
+
longitude and geoid height of the highest grid location.
|
|
1176
1168
|
'''
|
|
1177
1169
|
llh = self._highest if full or self.cropped else self._highest_ltd
|
|
1178
1170
|
return self._llh3LL(llh, LatLon)
|
|
@@ -1223,10 +1215,9 @@ class GeoidKarney(_GeoidBase):
|
|
|
1223
1215
|
(C{LatLon}) or C{None}.
|
|
1224
1216
|
@kwarg full: Search the full or limited latitude range (C{bool}).
|
|
1225
1217
|
|
|
1226
|
-
@return: If B{
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
lowest grid location.
|
|
1218
|
+
@return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
1219
|
+
height)} otherwise a B{C{LatLon}} instance with the lat-,
|
|
1220
|
+
longitude and geoid height of the lowest grid location.
|
|
1230
1221
|
'''
|
|
1231
1222
|
llh = self._lowest if full or self.cropped else self._lowest_ltd
|
|
1232
1223
|
return self._llh3LL(llh, LatLon)
|
pygeodesy/hausdorff.py
CHANGED
|
@@ -72,21 +72,20 @@ from pygeodesy.datums import _ellipsoidal_datum, _WGS84
|
|
|
72
72
|
from pygeodesy.errors import PointsError, _xattr, _xcallable, _xkwds, _xkwds_get
|
|
73
73
|
import pygeodesy.formy as _formy
|
|
74
74
|
from pygeodesy.interns import NN, _i_, _j_, _units_
|
|
75
|
-
# from pygeodesy.iters import points2 # from .points
|
|
75
|
+
# from pygeodesy.iters import points2 as _points # from .points
|
|
76
76
|
from pygeodesy.lazily import _ALL_LAZY, _FOR_DOCS
|
|
77
77
|
from pygeodesy.named import _name2__, _Named, _NamedTuple, _Pass
|
|
78
78
|
# from pygeodesy.namedTuples import PhiLam2Tuple # from .points
|
|
79
|
-
from pygeodesy.points import _distanceTo, points2 as _points2,
|
|
79
|
+
from pygeodesy.points import _distanceTo, PhiLam2Tuple, points2 as _points2, radians
|
|
80
80
|
from pygeodesy.props import Property, Property_RO, property_doc_, property_RO
|
|
81
|
-
from pygeodesy.units import Float, Number_
|
|
82
|
-
from pygeodesy
|
|
83
|
-
_Str_radians, _Str_radians2
|
|
81
|
+
from pygeodesy.units import Float, Number_
|
|
82
|
+
from pygeodesy import unitsBase as _unitsBase # _Str_..., _xUnit, _xUnits
|
|
84
83
|
|
|
85
84
|
# from math import radians # from .points
|
|
86
85
|
from random import Random
|
|
87
86
|
|
|
88
87
|
__all__ = _ALL_LAZY.hausdorff
|
|
89
|
-
__version__ = '24.06.
|
|
88
|
+
__version__ = '24.06.15'
|
|
90
89
|
|
|
91
90
|
|
|
92
91
|
class HausdorffError(PointsError):
|
|
@@ -104,7 +103,7 @@ class Hausdorff(_Named):
|
|
|
104
103
|
_kwds = {} # func_ options
|
|
105
104
|
_model = ()
|
|
106
105
|
_seed = None
|
|
107
|
-
_units = _Str_NN # XXX Str to _Pass and for backward compatibility
|
|
106
|
+
_units = _unitsBase._Str_NN # XXX Str to _Pass and for backward compatibility
|
|
108
107
|
|
|
109
108
|
def __init__(self, point1s, seed=None, units=NN, **name__kwds):
|
|
110
109
|
'''New C{Hausdorff...} calculator.
|
|
@@ -261,7 +260,7 @@ class Hausdorff(_Named):
|
|
|
261
260
|
|
|
262
261
|
@raise TypeError: Invalid B{C{units}}.
|
|
263
262
|
'''
|
|
264
|
-
self._units = _xUnits(units, Base=Float)
|
|
263
|
+
self._units = _unitsBase._xUnits(units, Base=Float)
|
|
265
264
|
|
|
266
265
|
@Property_RO
|
|
267
266
|
def wrap(self):
|
|
@@ -274,7 +273,7 @@ class HausdorffDegrees(Hausdorff):
|
|
|
274
273
|
'''L{Hausdorff} base class for distances from C{LatLon}
|
|
275
274
|
points in C{degrees}.
|
|
276
275
|
'''
|
|
277
|
-
_units = _Str_degrees
|
|
276
|
+
_units = _unitsBase._Str_degrees
|
|
278
277
|
|
|
279
278
|
if _FOR_DOCS:
|
|
280
279
|
__init__ = Hausdorff.__init__
|
|
@@ -290,7 +289,7 @@ class HausdorffRadians(Hausdorff):
|
|
|
290
289
|
'''L{Hausdorff} base class for distances from C{LatLon}
|
|
291
290
|
points converted from C{degrees} to C{radians}.
|
|
292
291
|
'''
|
|
293
|
-
_units = _Str_radians
|
|
292
|
+
_units = _unitsBase._Str_radians
|
|
294
293
|
|
|
295
294
|
if _FOR_DOCS:
|
|
296
295
|
__init__ = Hausdorff.__init__
|
|
@@ -318,8 +317,8 @@ class _HausdorffMeterRadians(Hausdorff):
|
|
|
318
317
|
the optional keyword arguments supplied at instantiation
|
|
319
318
|
of the C{Hausdorff*} sub-class.
|
|
320
319
|
'''
|
|
321
|
-
_units = _Str_meter
|
|
322
|
-
_units_ = _Str_radians
|
|
320
|
+
_units = _unitsBase._Str_meter
|
|
321
|
+
_units_ = _unitsBase._Str_radians
|
|
323
322
|
|
|
324
323
|
def directed(self, point2s, early=True):
|
|
325
324
|
'''Overloaded method L{Hausdorff.directed} to determine
|
|
@@ -426,7 +425,7 @@ class HausdorffDistanceTo(Hausdorff):
|
|
|
426
425
|
'''Compute the C{Hausdorff} distance based on the distance from the
|
|
427
426
|
points' C{LatLon.distanceTo} method, conventionally in C{meter}.
|
|
428
427
|
'''
|
|
429
|
-
_units = _Str_meter
|
|
428
|
+
_units = _unitsBase._Str_meter
|
|
430
429
|
|
|
431
430
|
def __init__(self, point1s, **seed_name__distanceTo_kwds):
|
|
432
431
|
'''New L{HausdorffDistanceTo} calculator.
|
|
@@ -464,7 +463,7 @@ class HausdorffEquirectangular(Hausdorff):
|
|
|
464
463
|
'''Compute the C{Hausdorff} distance based on the C{equirectangular} distance
|
|
465
464
|
in C{radians squared} like function L{pygeodesy.equirectangular}.
|
|
466
465
|
'''
|
|
467
|
-
_units = _Str_degrees2
|
|
466
|
+
_units = _unitsBase._Str_degrees2
|
|
468
467
|
|
|
469
468
|
def __init__(self, point1s, **seed_name__adjust_limit_wrap):
|
|
470
469
|
'''New L{HausdorffEquirectangular} calculator.
|
|
@@ -513,7 +512,7 @@ class HausdorffExact(Hausdorff):
|
|
|
513
512
|
'''Compute the C{Hausdorff} distance based on the I{angular}
|
|
514
513
|
distance in C{degrees} from method L{GeodesicExact}C{.Inverse}.
|
|
515
514
|
'''
|
|
516
|
-
_units = _Str_degrees
|
|
515
|
+
_units = _unitsBase._Str_degrees
|
|
517
516
|
|
|
518
517
|
def __init__(self, point1s, datum=None, **seed_name__wrap):
|
|
519
518
|
'''New L{HausdorffKarney} calculator.
|
|
@@ -543,7 +542,7 @@ class HausdorffFlatLocal(_HausdorffMeterRadians):
|
|
|
543
542
|
'''Compute the C{Hausdorff} distance based on the I{angular} distance in
|
|
544
543
|
C{radians squared} like function L{pygeodesy.flatLocal_}/L{pygeodesy.hubeny_}.
|
|
545
544
|
'''
|
|
546
|
-
_units = _Str_radians2
|
|
545
|
+
_units = _unitsBase._Str_radians2
|
|
547
546
|
|
|
548
547
|
def __init__(self, point1s, **seed_name__datum_scaled_wrap):
|
|
549
548
|
'''New L{HausdorffFlatLocal}/L{HausdorffHubeny} calculator.
|
|
@@ -634,7 +633,7 @@ class HausdorffKarney(Hausdorff):
|
|
|
634
633
|
<https://GeographicLib.SourceForge.io/Python/doc/code.html>}
|
|
635
634
|
Inverse method.
|
|
636
635
|
'''
|
|
637
|
-
_units = _Str_degrees
|
|
636
|
+
_units = _unitsBase._Str_degrees
|
|
638
637
|
|
|
639
638
|
def __init__(self, point1s, datum=None, **seed_name__wrap):
|
|
640
639
|
'''New L{HausdorffKarney} calculator.
|
|
@@ -823,7 +822,7 @@ class Hausdorff6Tuple(_NamedTuple):
|
|
|
823
822
|
'''Overloaded C{_NamedTuple.toUnits} for C{hd} and C{md} units.
|
|
824
823
|
'''
|
|
825
824
|
u = list(Hausdorff6Tuple._Units_)
|
|
826
|
-
u[0] = U = _xUnit(self.units, Float) # PYCHOK expected
|
|
825
|
+
u[0] = U = _unitsBase._xUnit(self.units, Float) # PYCHOK expected
|
|
827
826
|
u[4] = _Pass if self.md is None else U # PYCHOK expected
|
|
828
827
|
return _NamedTuple.toUnits(self.reUnit(*u), **Error_name) # PYCHOK self
|
|
829
828
|
|
pygeodesy/heights.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
|
-
u'''Height interpolations at C{LatLon} points from C{knots}.
|
|
4
|
+
u'''Height interpolations at C{LatLon} points from known C{knots}.
|
|
5
5
|
|
|
6
6
|
Classes L{HeightCubic}, L{HeightIDWcosineAndoyerLambert},
|
|
7
7
|
L{HeightIDWcosineForsytheAndoyerLambert}, L{HeightIDWcosineLaw},
|
|
@@ -91,7 +91,7 @@ from pygeodesy.units import _isDegrees, Float_, Int_
|
|
|
91
91
|
# from math import radians # from .points
|
|
92
92
|
|
|
93
93
|
__all__ = _ALL_LAZY.heights
|
|
94
|
-
__version__ = '24.06.
|
|
94
|
+
__version__ = '24.06.22'
|
|
95
95
|
|
|
96
96
|
_error_ = 'error'
|
|
97
97
|
_formy = _MODS.into(formy=__name__)
|
pygeodesy/internals.py
CHANGED
|
@@ -31,6 +31,12 @@ def _dunder_nameof(inst, *dflt):
|
|
|
31
31
|
return dflt[0] if dflt else inst.__class__.__name__
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
def _dunder_nameof_(*names__): # in .errors._IsnotError
|
|
35
|
+
'''(INTERNAL) Yield the _dunder_nameof or name.
|
|
36
|
+
'''
|
|
37
|
+
return map(_dunder_nameof, names__, names__)
|
|
38
|
+
|
|
39
|
+
|
|
34
40
|
def _Property_RO(method):
|
|
35
41
|
'''(INTERNAL) Can't I{recursively} import L{props.property_RO}.
|
|
36
42
|
'''
|
pygeodesy/interns.py
CHANGED
|
@@ -32,7 +32,7 @@ class _Int(int):
|
|
|
32
32
|
class Str_(str):
|
|
33
33
|
'''Extended, I{callable} C{str} class, not nameable.
|
|
34
34
|
|
|
35
|
-
@see: Nameable and callable class L{pygeodesy.Str}.
|
|
35
|
+
@see: Nameable and callable class L{Str<pygeodesy.unitsBase.Str>}.
|
|
36
36
|
'''
|
|
37
37
|
def join_(self, *args):
|
|
38
38
|
'''Join all positional B{C{args}} like C{self.join(B{args})}.
|
|
@@ -441,7 +441,7 @@ _LR_PAIRS = {_LANGLE_: _RANGLE_,
|
|
|
441
441
|
|
|
442
442
|
__all__ = (_NN_, # NOT MISSING!
|
|
443
443
|
Str_.__name__) # classes
|
|
444
|
-
__version__ = '24.06.
|
|
444
|
+
__version__ = '24.06.14'
|
|
445
445
|
|
|
446
446
|
if __name__ == '__main__':
|
|
447
447
|
|
pygeodesy/karney.py
CHANGED
|
@@ -160,7 +160,7 @@ from pygeodesy.utily import atan2d, sincos2d, tand, _unrollon, fabs
|
|
|
160
160
|
# from math import fabs # from .utily
|
|
161
161
|
|
|
162
162
|
__all__ = _ALL_LAZY.karney
|
|
163
|
-
__version__ = '24.
|
|
163
|
+
__version__ = '24.06.27'
|
|
164
164
|
|
|
165
165
|
_K_2_0 = _getenv('PYGEODESY_GEOGRAPHICLIB', _2_) == _2_
|
|
166
166
|
_perimeter_ = 'perimeter'
|
|
@@ -213,7 +213,7 @@ class Caps(object): # PYCHOK
|
|
|
213
213
|
EMPTY = 0 # formerly aka NONE
|
|
214
214
|
_CAP_1 = 1 << 0 # for goedesicw only
|
|
215
215
|
_CAP_1p = 1 << 1 # for goedesicw only
|
|
216
|
-
|
|
216
|
+
_CAP_2 = 1 << 2
|
|
217
217
|
_CAP_3 = 1 << 3 # for goedesicw only
|
|
218
218
|
# _CAP_4 = 1 << 4
|
|
219
219
|
# _CAP_ALL = 0x1F
|
|
@@ -233,7 +233,9 @@ class Caps(object): # PYCHOK
|
|
|
233
233
|
_DIRECT3 = AZIMUTH | LATITUDE | LONGITUDE | _CAP_3 # for goedesicw only
|
|
234
234
|
_INVERSE3 = AZIMUTH | DISTANCE | _CAP_1 # for goedesicw only
|
|
235
235
|
_STD = STANDARD | _CAP_3 | _CAP_1 # for goedesicw only
|
|
236
|
-
_STD_LINE = _STD | _CAP_1p
|
|
236
|
+
_STD_LINE = _STD | _CAP_2 | _CAP_1p # for goedesici and -w
|
|
237
|
+
|
|
238
|
+
LINE_CAPS = _STD_LINE | REDUCEDLENGTH | GEODESICSCALE # .geodesici only
|
|
237
239
|
|
|
238
240
|
LINE_OFF = 1 << 15 # Line without updates from parent geodesic or rhumb
|
|
239
241
|
LONG_UNROLL = 1 << 16 # unroll C{lon2} in .Direct and .Position
|
|
@@ -308,6 +310,10 @@ and C{ALL} - all of the above.
|
|
|
308
310
|
|
|
309
311
|
C{STANDARD} = C{AZIMUTH | DISTANCE | DISTANCE_IN | LATITUDE | LONGITUDE}'''
|
|
310
312
|
|
|
313
|
+
_KEY2Caps = dict(m12=Caps.REDUCEDLENGTH, # see GDict._unCaps
|
|
314
|
+
M12=Caps.GEODESICSCALE,
|
|
315
|
+
M21=Caps.GEODESICSCALE, S12=Caps.AREA)
|
|
316
|
+
|
|
311
317
|
|
|
312
318
|
class _CapsBase(_NamedBase): # in .auxilats, .geodesicx.gxbases
|
|
313
319
|
'''(INTERNAL) Base class for C{[_]Geodesic*Exact}.
|
|
@@ -320,11 +326,13 @@ class _CapsBase(_NamedBase): # in .auxilats, .geodesicx.gxbases
|
|
|
320
326
|
EMPTY = Caps.EMPTY # aka NONE
|
|
321
327
|
GEODESICSCALE = Caps.GEODESICSCALE
|
|
322
328
|
LATITUDE = Caps.LATITUDE
|
|
329
|
+
LINE_CAPS = Caps.LINE_CAPS
|
|
323
330
|
LINE_OFF = Caps.LINE_OFF
|
|
324
331
|
LONGITUDE = Caps.LONGITUDE
|
|
325
332
|
LONG_UNROLL = Caps.LONG_UNROLL
|
|
326
333
|
REDUCEDLENGTH = Caps.REDUCEDLENGTH
|
|
327
334
|
STANDARD = Caps.STANDARD
|
|
335
|
+
_STD_LINE = Caps._STD_LINE # for geodesici
|
|
328
336
|
|
|
329
337
|
_caps = 0 # None
|
|
330
338
|
_debug = 0 # or Caps._DEBUG_...
|
|
@@ -453,6 +461,14 @@ class GDict(ADict): # XXX _NamedDict
|
|
|
453
461
|
t = tuple(_g(self, n, dflt) for n in nTuple._Names_)
|
|
454
462
|
return nTuple(t, iteration=self._iteration)
|
|
455
463
|
|
|
464
|
+
def _unCaps(self, outmask): # in .geodsolve
|
|
465
|
+
'''(INTERNAL) Remove superfluous items.
|
|
466
|
+
'''
|
|
467
|
+
for k, m in _KEY2Caps.items():
|
|
468
|
+
if k in self and not (outmask & m):
|
|
469
|
+
self.pop(k) # delattr(self, k)
|
|
470
|
+
return self
|
|
471
|
+
|
|
456
472
|
|
|
457
473
|
class Inverse10Tuple(_GTuple):
|
|
458
474
|
'''10-Tuple C{(a12, s12, salp1, calp1, salp2, calp2, m12, M12, M21, S12)} with arc length
|
|
@@ -882,7 +898,7 @@ def _unroll2(lon1, lon2, wrap=False): # see .ellipsoidalBaseDI._intersects2
|
|
|
882
898
|
'''Unroll B{C{lon2 - lon1}} like C{geodesic.Geodesic.Inverse}.
|
|
883
899
|
|
|
884
900
|
@return: 2-Tuple C{(B{lon2} - B{lon1}, B{lon2})} with B{C{lon2}}
|
|
885
|
-
unrolled if B{
|
|
901
|
+
unrolled if C{B{wrap} is True}, normalized otherwise.
|
|
886
902
|
'''
|
|
887
903
|
if wrap:
|
|
888
904
|
d, t = _diff182(lon1, lon2)
|
pygeodesy/ktm.py
CHANGED
|
@@ -67,7 +67,7 @@ from cmath import polar
|
|
|
67
67
|
from math import atan2, asinh, cos, cosh, degrees, fabs, sin, sinh, sqrt, tanh
|
|
68
68
|
|
|
69
69
|
__all__ = _ALL_LAZY.ktm
|
|
70
|
-
__version__ = '24.
|
|
70
|
+
__version__ = '24.06.11'
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
class KTMError(_ValueError):
|
|
@@ -119,18 +119,16 @@ class KTransverseMercator(_NamedBase):
|
|
|
119
119
|
raiser=False, **TMorder_name):
|
|
120
120
|
'''New L{KTransverseMercator}.
|
|
121
121
|
|
|
122
|
-
@kwarg a_earth: This rhumb's earth (L{Ellipsoid}, L{Ellipsoid2},
|
|
123
|
-
L{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
is a C{scalar}, ignored otherwise.
|
|
122
|
+
@kwarg a_earth: This rhumb's earth (L{Ellipsoid}, L{Ellipsoid2}, L{a_f2Tuple},
|
|
123
|
+
L{Datum}, 2-tuple (C{a, f})) or the equatorial radius (C{meter}).
|
|
124
|
+
@kwarg f: The ellipsoid's flattening (C{scalar}), required if B{C{a_earth}} is
|
|
125
|
+
is C{meter}, ignored otherwise.
|
|
127
126
|
@kwarg lon0: The central meridian (C{degrees180}).
|
|
128
127
|
@kwarg k0: Central scale factor (C{scalar}).
|
|
129
|
-
@kwarg raiser: If C{True}, throw a L{KTMError} for C{forward}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this L{KTransverseMercator}, see property C{TMorder}.
|
|
128
|
+
@kwarg raiser: If C{True}, throw a L{KTMError} for C{forward} singularities (C{bool}).
|
|
129
|
+
@kwarg TMorder_name: Optional C{B{name}=NN} (C{str}) and optional keyword argument
|
|
130
|
+
C{B{TMorder}=6} for the order of this L{KTransverseMercator}, see
|
|
131
|
+
property C{TMorder}.
|
|
134
132
|
|
|
135
133
|
@raise KTMError: Invalid B{C{a_earth}}, B{C{f}} or B{C{TMorder}}.
|
|
136
134
|
'''
|
|
@@ -229,14 +227,13 @@ class KTransverseMercator(_NamedBase):
|
|
|
229
227
|
@arg lon0: Central meridian of the projection (C{degrees180}).
|
|
230
228
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
231
229
|
|
|
232
|
-
@return: L{Forward4Tuple}C{(easting, northing, gamma, scale)}
|
|
233
|
-
|
|
230
|
+
@return: L{Forward4Tuple}C{(easting, northing, gamma, scale)} with
|
|
231
|
+
C{easting} and C{northing} in C{meter}, unfalsed, the
|
|
234
232
|
meridian convergence C{gamma} at point in C{degrees180}
|
|
235
233
|
and the C{scale} of projection at point C{scalar}. Any
|
|
236
234
|
value may be C{NAN}, C{NINF} or C{INF} for singularities.
|
|
237
235
|
|
|
238
|
-
@raise KTMError: For singularities, iff property C{raiser} is
|
|
239
|
-
C{True}.
|
|
236
|
+
@raise KTMError: For singularities, iff property C{raiser} is C{True}.
|
|
240
237
|
'''
|
|
241
238
|
lat, _lat = _unsigned2(_fix90(lat - self._lat0))
|
|
242
239
|
lon, _ = _diff182((self.lon0 if lon0 is None else lon0), lon)
|
|
@@ -343,7 +340,7 @@ class KTransverseMercator(_NamedBase):
|
|
|
343
340
|
@arg lat0: Latitude of the central parallel (C{degrees90}).
|
|
344
341
|
@arg lon0: Longitude of the central parallel (C{degrees180}).
|
|
345
342
|
|
|
346
|
-
@return: 2-Tuple C{(lat0, lon0)}
|
|
343
|
+
@return: 2-Tuple C{(lat0, lon0)} with the previous central
|
|
347
344
|
parallel and meridian.
|
|
348
345
|
|
|
349
346
|
@raise KTMError: Invalid B{C{lat0}} or B{C{lon0}}.
|
pygeodesy/latlonBase.py
CHANGED
|
@@ -54,7 +54,7 @@ from contextlib import contextmanager
|
|
|
54
54
|
from math import asin, cos, degrees, fabs, radians
|
|
55
55
|
|
|
56
56
|
__all__ = _ALL_LAZY.latlonBase
|
|
57
|
-
__version__ = '24.06.
|
|
57
|
+
__version__ = '24.06.11'
|
|
58
58
|
|
|
59
59
|
_formy = _MODS.into(formy=__name__)
|
|
60
60
|
|
|
@@ -143,17 +143,17 @@ class LatLonBase(_NamedBase):
|
|
|
143
143
|
bounding box centered at this location.
|
|
144
144
|
|
|
145
145
|
@arg wide: Longitudinal box width (C{meter}, same units as
|
|
146
|
-
B{C{radius}} or C{degrees} if B{
|
|
146
|
+
B{C{radius}} or C{degrees} if C{B{radius} is None}).
|
|
147
147
|
@arg tall: Latitudinal box size (C{meter}, same units as
|
|
148
|
-
B{C{radius}} or C{degrees} if B{
|
|
148
|
+
B{C{radius}} or C{degrees} if C{B{radius} is None}).
|
|
149
149
|
@kwarg radius: Mean earth radius (C{meter}) or C{None} if I{both}
|
|
150
150
|
B{C{wide}} and B{C{tall}} are in C{degrees}.
|
|
151
151
|
@kwarg height: Height for C{latlonSW} and C{latlonNE} (C{meter}),
|
|
152
152
|
overriding the point's height.
|
|
153
153
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
154
154
|
|
|
155
|
-
@return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)}, the
|
|
156
|
-
|
|
155
|
+
@return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)}, the lower-left
|
|
156
|
+
and upper-right corner (C{LatLon}).
|
|
157
157
|
|
|
158
158
|
@see: U{https://www.Movable-Type.co.UK/scripts/latlong-db.html}
|
|
159
159
|
'''
|
|
@@ -1396,13 +1396,12 @@ class LatLonBase(_NamedBase):
|
|
|
1396
1396
|
(C{meter}, conventionally).
|
|
1397
1397
|
@kwarg Cartesian: Optional class to return the geocentric
|
|
1398
1398
|
coordinates (C{Cartesian}) or C{None}.
|
|
1399
|
-
@kwarg Cartesian_kwds: Optional, additional B{C{Cartesian}}
|
|
1400
|
-
|
|
1401
|
-
C{B{Cartesian} is None}.
|
|
1399
|
+
@kwarg Cartesian_kwds: Optional, additional B{C{Cartesian}} keyword
|
|
1400
|
+
arguments, ignored if C{B{Cartesian} is None}.
|
|
1402
1401
|
|
|
1403
|
-
@return: A B{C{Cartesian}} or if B{C{Cartesian}
|
|
1404
|
-
|
|
1405
|
-
|
|
1402
|
+
@return: A B{C{Cartesian}} or if B{C{Cartesian} is None}, an
|
|
1403
|
+
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
1404
|
+
with C{C=0} and C{M} if available.
|
|
1406
1405
|
|
|
1407
1406
|
@raise TypeError: Invalid B{C{Cartesian}} or B{C{Cartesian_kwds}}.
|
|
1408
1407
|
|
|
@@ -1512,11 +1511,10 @@ class LatLonBase(_NamedBase):
|
|
|
1512
1511
|
additional B{C{Nvector}} keyword arguments, ignored if
|
|
1513
1512
|
C{B{Nvector} is None}.
|
|
1514
1513
|
|
|
1515
|
-
@return: An B{C{Nvector}} or
|
|
1516
|
-
|
|
1514
|
+
@return: An named B{C{Nvector}} or if C{B{Nvector} is None} a named
|
|
1515
|
+
L{Vector4Tuple}C{(x, y, z, h)}.
|
|
1517
1516
|
|
|
1518
|
-
@raise TypeError: Invalid B{C{h}}, B{C{Nvector}} or
|
|
1519
|
-
B{C{name_Nvector_kwds}} item.
|
|
1517
|
+
@raise TypeError: Invalid B{C{h}}, B{C{Nvector}} or B{C{name_Nvector_kwds}}.
|
|
1520
1518
|
|
|
1521
1519
|
@see: Methods C{toCartesian}, C{toVector} and C{toVector3d}.
|
|
1522
1520
|
'''
|
|
@@ -1548,7 +1546,7 @@ class LatLonBase(_NamedBase):
|
|
|
1548
1546
|
|
|
1549
1547
|
@return: This point in the specified C{B{form}at}, etc. (C{str} or
|
|
1550
1548
|
a 2- or 3-tuple C{(lat_str, lon_str[, height_str])} if
|
|
1551
|
-
C{
|
|
1549
|
+
B{C{joined}} is C{NN} or C{None}).
|
|
1552
1550
|
|
|
1553
1551
|
@see: Function L{pygeodesy.latDMS} or L{pygeodesy.lonDMS} for more
|
|
1554
1552
|
details about keyword arguments C{B{form}at}, C{B{prec}ision},
|
|
@@ -1569,10 +1567,10 @@ class LatLonBase(_NamedBase):
|
|
|
1569
1567
|
@kwarg Vector_kwds: Optional, additional B{C{Vector}} keyword
|
|
1570
1568
|
arguments, ignored if C{B{Vector} is None}.
|
|
1571
1569
|
|
|
1572
|
-
@return: A named B{C{Vector}} or if B{
|
|
1570
|
+
@return: A named B{C{Vector}} or if C{B{Vector} is None} a
|
|
1573
1571
|
named L{Vector3Tuple}C{(x, y, z)}.
|
|
1574
1572
|
|
|
1575
|
-
@raise TypeError: Invalid B{C{Vector}} or B{C{Vector_kwds}}
|
|
1573
|
+
@raise TypeError: Invalid B{C{Vector}} or B{C{Vector_kwds}}.
|
|
1576
1574
|
|
|
1577
1575
|
@see: Methods C{toCartesian}, C{toNvector} and C{toVector3d}.
|
|
1578
1576
|
'''
|
|
@@ -1587,7 +1585,7 @@ class LatLonBase(_NamedBase):
|
|
|
1587
1585
|
|
|
1588
1586
|
@return: Named, unit vector or vector (L{Vector3d}).
|
|
1589
1587
|
|
|
1590
|
-
@raise TypeError: Invalid B{C{Vector3d_kwds}}
|
|
1588
|
+
@raise TypeError: Invalid B{C{Vector3d_kwds}}.
|
|
1591
1589
|
|
|
1592
1590
|
@see: Methods C{toCartesian}, C{toNvector} and C{toVector}.
|
|
1593
1591
|
'''
|
pygeodesy/lazily.py
CHANGED
|
@@ -283,6 +283,7 @@ _ALL_LAZY = _NamedEnum_RO(_name='_ALL_LAZY',
|
|
|
283
283
|
fsums=_i('Fsum', 'DivMod2Tuple', 'Fsum2Tuple', 'ResidualError',
|
|
284
284
|
'fsum', 'fsum_', 'fsumf_', 'fsum1', 'fsum1_', 'fsum1f_'),
|
|
285
285
|
gars=_i('Garef', 'GARSError'),
|
|
286
|
+
geodesici=_i('Intersector', 'Intersector5Tuple', 'XDist'),
|
|
286
287
|
geodesicw=_i('Geodesic', 'GeodesicLine', 'Geodesic_WGS84'),
|
|
287
288
|
geodesicx=_i('gx', 'gxarea', 'gxbases', 'gxline', # modules
|
|
288
289
|
'GeodesicAreaExact', 'GeodesicExact', 'GeodesicLineExact', 'PolygonArea'),
|
|
@@ -367,9 +368,9 @@ _ALL_LAZY = _NamedEnum_RO(_name='_ALL_LAZY',
|
|
|
367
368
|
units=_i('Band', 'Bearing', 'Bearing_', 'Bool',
|
|
368
369
|
'Degrees', 'Degrees_', 'Degrees2', 'Distance', 'Distance_', 'Easting', 'Epoch',
|
|
369
370
|
'Feet', 'FIx', 'Float_', 'Height', 'Height_', 'HeightX', 'Int_',
|
|
370
|
-
'Lam', '
|
|
371
|
+
'Lam', 'Lamd', 'Lat', 'Lat_', 'Lon', 'Lon_',
|
|
371
372
|
'Meter', 'Meter_', 'Meter2', 'Meter3', 'Northing', 'Number_',
|
|
372
|
-
'Phi', '
|
|
373
|
+
'Phi', 'Phid', 'Precision_', 'Radians', 'Radians_', 'Radians2',
|
|
373
374
|
'Radius_', 'Scalar', 'Scalar_', 'Zone'),
|
|
374
375
|
unitsBase=_i('Float', 'Int', 'Radius', 'Str'),
|
|
375
376
|
ups=_i('Ups', 'UPSError', 'parseUPS5', 'toUps8', 'upsZoneBand5'),
|
|
@@ -406,13 +407,13 @@ _ALL_DEPRECATED = _NamedEnum_RO(_name='_ALL_DEPRECATED',
|
|
|
406
407
|
deprecated_bases=_i('LatLonHeightBase', 'points2'),
|
|
407
408
|
deprecated_classes=_i('ClipCS3Tuple', 'EasNorExact4Tuple', 'EcefCartesian', 'Fn_rt',
|
|
408
409
|
'HeightIDW', 'HeightIDW2', 'HeightIDW3', 'Helmert7Tuple',
|
|
409
|
-
'LatLonExact4Tuple', 'NearestOn4Tuple', 'Ned3Tuple',
|
|
410
|
-
'RefFrameError', 'Rhumb7Tuple', 'RhumbOrder2Tuple',
|
|
410
|
+
'Lam_', 'LatLonExact4Tuple', 'NearestOn4Tuple', 'Ned3Tuple',
|
|
411
|
+
'Phi_', 'RefFrameError', 'Rhumb7Tuple', 'RhumbOrder2Tuple',
|
|
411
412
|
'Transform7Tuple', 'TriAngle4Tuple', 'UtmUps4Tuple'),
|
|
412
413
|
deprecated_consterns=_i('EPS1_2', 'MANTIS', 'OK'),
|
|
413
414
|
deprecated_datum=_i('Curvature2Tuple', 'Datum', 'Ellipsoid', 'Transform', # assert
|
|
414
415
|
'Datums', 'Ellipsoids', 'Transforms',
|
|
415
|
-
'
|
|
416
|
+
'R_FM', 'R_KM', 'R_M', 'R_MA', 'R_MB', 'R_NM', 'R_SM', 'R_VM'),
|
|
416
417
|
deprecated_functions=_i('anStr', 'areaof', 'atand', 'bounds', # most of the DEPRECATED functions, except ...
|
|
417
418
|
'clipCS3', 'clipDMS', 'clipStr', 'collins', 'copysign', # ... ellipsoidal, spherical flavors
|
|
418
419
|
'decodeEPSG2', 'encodeEPSG', 'enStr2', 'equirectangular_', 'equirectangular3',
|
|
@@ -518,7 +519,7 @@ class _ALL_MODS(_internals._MODS_Base):
|
|
|
518
519
|
_internals._MODS = _ALL_MODS = _ALL_MODS() # PYCHOK singleton
|
|
519
520
|
|
|
520
521
|
__all__ = _ALL_LAZY.lazily
|
|
521
|
-
__version__ = '24.06.
|
|
522
|
+
__version__ = '24.06.19'
|
|
522
523
|
|
|
523
524
|
|
|
524
525
|
def _ALL_OTHER(*objs):
|