pygeodesy 24.7.24__py2.py3-none-any.whl → 24.8.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.7.24.dist-info → PyGeodesy-24.8.24.dist-info}/METADATA +20 -19
- {PyGeodesy-24.7.24.dist-info → PyGeodesy-24.8.24.dist-info}/RECORD +57 -57
- {PyGeodesy-24.7.24.dist-info → PyGeodesy-24.8.24.dist-info}/WHEEL +1 -1
- pygeodesy/__init__.py +26 -27
- pygeodesy/auxilats/auxAngle.py +2 -2
- pygeodesy/auxilats/auxDST.py +3 -3
- pygeodesy/azimuthal.py +4 -4
- pygeodesy/basics.py +3 -3
- pygeodesy/cartesianBase.py +6 -6
- pygeodesy/constants.py +11 -11
- pygeodesy/css.py +5 -5
- 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/ellipsoids.py +3 -3
- pygeodesy/epsg.py +3 -3
- pygeodesy/fmath.py +2 -1
- pygeodesy/formy.py +2 -2
- pygeodesy/fsums.py +4 -4
- pygeodesy/gars.py +66 -58
- pygeodesy/geodesici.py +4 -10
- pygeodesy/geodesicx/gx.py +3 -3
- pygeodesy/geodesicx/gxarea.py +3 -3
- pygeodesy/geodsolve.py +3 -3
- pygeodesy/geohash.py +491 -267
- pygeodesy/geoids.py +298 -316
- pygeodesy/heights.py +176 -194
- pygeodesy/internals.py +39 -6
- pygeodesy/interns.py +2 -3
- pygeodesy/karney.py +2 -2
- pygeodesy/latlonBase.py +14 -8
- pygeodesy/lazily.py +22 -21
- pygeodesy/ltp.py +6 -7
- pygeodesy/ltpTuples.py +12 -6
- pygeodesy/named.py +5 -4
- pygeodesy/namedTuples.py +14 -1
- pygeodesy/osgr.py +7 -7
- pygeodesy/points.py +2 -2
- pygeodesy/resections.py +7 -7
- 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 +210 -204
- pygeodesy/units.py +36 -19
- 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 +109 -101
- {PyGeodesy-24.7.24.dist-info → PyGeodesy-24.8.24.dist-info}/top_level.txt +0 -0
pygeodesy/internals.py
CHANGED
|
@@ -18,6 +18,7 @@ _0_0 = 0.0 # PYCHOK in .basics, .constants
|
|
|
18
18
|
_arm64_ = 'arm64'
|
|
19
19
|
_iOS_ = 'iOS'
|
|
20
20
|
_macOS_ = 'macOS'
|
|
21
|
+
_SIsecs = 'fs', 'ps', 'ns', 'us', 'ms', 'sec' # reversed
|
|
21
22
|
_Windows_ = 'Windows'
|
|
22
23
|
|
|
23
24
|
|
|
@@ -213,6 +214,13 @@ class _MODS_Base(object):
|
|
|
213
214
|
from pygeodesy import streprs # DON'T _lazy_import2
|
|
214
215
|
return streprs
|
|
215
216
|
|
|
217
|
+
@_Property_RO
|
|
218
|
+
def version(self):
|
|
219
|
+
'''Get pygeodesy version, I{once}.
|
|
220
|
+
'''
|
|
221
|
+
from pygeodesy import version
|
|
222
|
+
return version
|
|
223
|
+
|
|
216
224
|
_MODS = _MODS_Base() # PYCHOK overwritten by .lazily
|
|
217
225
|
|
|
218
226
|
|
|
@@ -430,12 +438,31 @@ def _print7(nl=0, nt=0, prec=6, prefix=NN, sep=_SPACE_, file=_sys.stdout,
|
|
|
430
438
|
|
|
431
439
|
|
|
432
440
|
def _Pythonarchine(sep=NN): # in .lazily, test/bases.py versions
|
|
433
|
-
'''(INTERNAL) Get PyPy and Python versions,
|
|
441
|
+
'''(INTERNAL) Get PyPy and Python versions, bits and machine as C{3- or 4-list} or C{str}.
|
|
434
442
|
'''
|
|
435
443
|
l3 = _MODS.Pythonarchine
|
|
436
444
|
return sep.join(l3) if sep else l3 # 3- or 4-list
|
|
437
445
|
|
|
438
446
|
|
|
447
|
+
def _secs2str(secs): # in .geoids, ../test/bases.py
|
|
448
|
+
'''Convert a time in C{secs} to C{str}.
|
|
449
|
+
'''
|
|
450
|
+
if secs < _MODS.constants._100_0:
|
|
451
|
+
unit = len(_SIsecs) - 1
|
|
452
|
+
while 0 < secs < 1 and unit > 0:
|
|
453
|
+
secs *= 1e3 # _1000_0
|
|
454
|
+
unit -= 1
|
|
455
|
+
t = '%.3f %s' % (secs, _SIsecs[unit])
|
|
456
|
+
else:
|
|
457
|
+
m, s = divmod(secs, 60)
|
|
458
|
+
if m < 60:
|
|
459
|
+
t = '%d:%06.3f' % (int(m), s)
|
|
460
|
+
else:
|
|
461
|
+
h, m = divmod(int(m), 60)
|
|
462
|
+
t = '%d:%02d:%06.3f' % (h, m, s)
|
|
463
|
+
return t
|
|
464
|
+
|
|
465
|
+
|
|
439
466
|
def _sizeof(obj):
|
|
440
467
|
'''(INTERNAL) Recursively size an C{obj}ect.
|
|
441
468
|
|
|
@@ -576,16 +603,22 @@ def _version_ints(vs):
|
|
|
576
603
|
return tuple(_ints(vs))
|
|
577
604
|
|
|
578
605
|
|
|
606
|
+
def _versions(sep=_SPACE_):
|
|
607
|
+
'''(INTERNAL) Get pygeodesy, PyPy and Python versions, bits, machine and OS as C{7- or 8-list} or C{str}.
|
|
608
|
+
'''
|
|
609
|
+
l7 = [_pygeodesy_, _MODS.version] + _Pythonarchine() + _osversion2()
|
|
610
|
+
return sep.join(l7) if sep else l7 # 5- or 6-list
|
|
611
|
+
|
|
612
|
+
|
|
579
613
|
__all__ = tuple(map(_dunder_nameof, (machine, print_, printf)))
|
|
580
|
-
__version__ = '24.
|
|
614
|
+
__version__ = '24.08.24'
|
|
581
615
|
|
|
582
616
|
if _dunder_ismain(__name__): # PYCHOK no cover
|
|
583
617
|
|
|
584
|
-
from pygeodesy import _isfrozen, isLazy
|
|
618
|
+
from pygeodesy import _isfrozen, isLazy
|
|
585
619
|
|
|
586
|
-
print_(
|
|
587
|
-
|
|
588
|
-
'isLazy', isLazy]))
|
|
620
|
+
print_(*(_versions(sep=NN) + ['_isfrozen', _isfrozen,
|
|
621
|
+
'isLazy', isLazy]))
|
|
589
622
|
|
|
590
623
|
# **) MIT License
|
|
591
624
|
#
|
pygeodesy/interns.py
CHANGED
|
@@ -184,7 +184,6 @@ _concentric_ = 'concentric' # PYCHOK OK
|
|
|
184
184
|
_convergence_ = _Prefix('convergence') # PYCHOK OK
|
|
185
185
|
_conversion_ = 'conversion' # PYCHOK OK
|
|
186
186
|
_convex_ = 'convex' # PYCHOK OK
|
|
187
|
-
_cubic_ = 'cubic' # PYCHOK OK
|
|
188
187
|
_d_ = 'd' # PYCHOK OK
|
|
189
188
|
_D_ = 'D' # PYCHOK OK
|
|
190
189
|
_DASH_ = Str_('-') # PYCHOK == _MINUS_
|
|
@@ -250,6 +249,7 @@ _inside_ = 'inside' # PYCHOK OK
|
|
|
250
249
|
_insufficient_ = 'insufficient' # PYCHOK OK
|
|
251
250
|
_intersection_ = 'intersection' # PYCHOK OK
|
|
252
251
|
_Intl1924_ = 'Intl1924' # PYCHOK OK
|
|
252
|
+
_INV_ = 'INV' # PYCHOK INValid
|
|
253
253
|
_invalid_ = 'invalid' # PYCHOK OK
|
|
254
254
|
_invokation_ = 'invokation' # PYCHOK OK
|
|
255
255
|
_j_ = 'j' # PYCHOK OK
|
|
@@ -270,7 +270,6 @@ _LCURLY_ = '{' # PYCHOK LBRACE
|
|
|
270
270
|
_len_ = 'len' # PYCHOK OK
|
|
271
271
|
_limit_ = 'limit' # PYCHOK OK
|
|
272
272
|
_line_ = 'line' # PYCHOK OK
|
|
273
|
-
_linear_ = 'linear' # PYCHOK OK
|
|
274
273
|
_LPAREN_ = '(' # PYCHOK OK
|
|
275
274
|
_lon_ = 'lon' # PYCHOK OK
|
|
276
275
|
_lon0_ = 'lon0' # PYCHOK OK
|
|
@@ -441,7 +440,7 @@ _LR_PAIRS = {_LANGLE_: _RANGLE_,
|
|
|
441
440
|
|
|
442
441
|
__all__ = (_NN_, # NOT MISSING!
|
|
443
442
|
Str_.__name__) # classes
|
|
444
|
-
__version__ = '24.
|
|
443
|
+
__version__ = '24.08.22'
|
|
445
444
|
|
|
446
445
|
if __name__ == '__main__':
|
|
447
446
|
|
pygeodesy/karney.py
CHANGED
|
@@ -155,14 +155,14 @@ from pygeodesy.interns import NN, _2_, _a12_, _area_, _azi1_, _azi2_, _azi12_, \
|
|
|
155
155
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, _getenv
|
|
156
156
|
from pygeodesy.named import ADict, _NamedBase, _NamedTuple, notImplemented, _Pass
|
|
157
157
|
from pygeodesy.props import deprecated_method, Property_RO, property_ROnce
|
|
158
|
-
from pygeodesy.units import
|
|
158
|
+
from pygeodesy.units import Azimuth as _Azi, Degrees as _Deg, Lat, Lon, \
|
|
159
159
|
Meter as _M, Meter2 as _M2, Number_
|
|
160
160
|
from pygeodesy.utily import atan2d, sincos2d, tand, _unrollon, fabs
|
|
161
161
|
|
|
162
162
|
# from math import fabs # from .utily
|
|
163
163
|
|
|
164
164
|
__all__ = _ALL_LAZY.karney
|
|
165
|
-
__version__ = '24.07.
|
|
165
|
+
__version__ = '24.07.25'
|
|
166
166
|
|
|
167
167
|
_K_2_0 = _getenv('PYGEODESY_GEOGRAPHICLIB', _2_) == _2_
|
|
168
168
|
_perimeter_ = 'perimeter'
|
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.
|
|
57
|
+
__version__ = '24.08.18'
|
|
58
58
|
|
|
59
59
|
_formy = _MODS.into(formy=__name__)
|
|
60
60
|
|
|
@@ -247,7 +247,7 @@ class LatLonBase(_NamedBase):
|
|
|
247
247
|
|
|
248
248
|
@arg point2: Second point (C{LatLon}).
|
|
249
249
|
@arg point3: Third point (C{LatLon}).
|
|
250
|
-
@kwarg circum: If C{True} return the C{circumradius} and C{circumcenter},
|
|
250
|
+
@kwarg circum: If C{True}, return the C{circumradius} and C{circumcenter},
|
|
251
251
|
always, ignoring the I{Meeus}' Type I case (C{bool}).
|
|
252
252
|
@kwarg eps: Tolerance for function L{pygeodesy.trilaterate3d2}.
|
|
253
253
|
@kwarg wrap_name: Optional C{B{name}=NN} (C{str}) and optional keyword
|
|
@@ -699,9 +699,9 @@ class LatLonBase(_NamedBase):
|
|
|
699
699
|
I{overriding} this datum (L{Datum}, L{Ellipsoid},
|
|
700
700
|
L{Ellipsoid2}, L{a_f2Tuple}, L{Triaxial}, L{Triaxial_},
|
|
701
701
|
L{JacobiConformal} or C{meter}, conventionally).
|
|
702
|
-
@kwarg normal: If C{True} the projection is the normal to this
|
|
703
|
-
|
|
704
|
-
|
|
702
|
+
@kwarg normal: If C{True}, the projection is the normal to this ellipsoid's
|
|
703
|
+
surface, otherwise the intersection of the I{radial} line to
|
|
704
|
+
this ellipsoid's center (C{bool}).
|
|
705
705
|
@kwarg LatLon: Optional class to return the projection, height and
|
|
706
706
|
datum (C{LatLon}) or C{None}.
|
|
707
707
|
@kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword arguments,
|
|
@@ -1483,8 +1483,8 @@ class LatLonBase(_NamedBase):
|
|
|
1483
1483
|
'''Get this point I{normalized} to C{abs(lat) <= 90}
|
|
1484
1484
|
and C{abs(lon) <= 180}.
|
|
1485
1485
|
|
|
1486
|
-
@kwarg deep: If C{True} make a deep, otherwise a
|
|
1487
|
-
|
|
1486
|
+
@kwarg deep: If C{True}, make a deep, otherwise a shallow
|
|
1487
|
+
copy (C{bool}).
|
|
1488
1488
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1489
1489
|
|
|
1490
1490
|
@return: A copy of this point, I{normalized} (C{LatLon}),
|
|
@@ -1534,7 +1534,7 @@ class LatLonBase(_NamedBase):
|
|
|
1534
1534
|
|
|
1535
1535
|
@kwarg form: The lat-/longitude C{B{form}at} to use (C{str}), see
|
|
1536
1536
|
functions L{pygeodesy.latDMS} or L{pygeodesy.lonDMS}.
|
|
1537
|
-
@kwarg joined: Separator to join the lat-, longitude and
|
|
1537
|
+
@kwarg joined: Separator to join the lat-, longitude and height
|
|
1538
1538
|
strings (C{str} or C{None} or C{NN} for non-joined).
|
|
1539
1539
|
@kwarg m: Optional unit of the height (C{str}), use C{None} to
|
|
1540
1540
|
exclude height from the returned string.
|
|
@@ -1650,6 +1650,12 @@ class LatLonBase(_NamedBase):
|
|
|
1650
1650
|
'''
|
|
1651
1651
|
return self._ecef9.xyz
|
|
1652
1652
|
|
|
1653
|
+
@property_RO
|
|
1654
|
+
def xyz3(self):
|
|
1655
|
+
'''Get the I{geocentric} C{(x, y, z)} coordinates as C{3-tuple}.
|
|
1656
|
+
'''
|
|
1657
|
+
return tuple(self.xyz)
|
|
1658
|
+
|
|
1653
1659
|
@Property_RO
|
|
1654
1660
|
def xyzh(self):
|
|
1655
1661
|
'''Get the I{geocentric} C{(x, y, z)} coordinates and height (L{Vector4Tuple}C{(x, y, z, h)})
|
pygeodesy/lazily.py
CHANGED
|
@@ -31,8 +31,7 @@ from pygeodesy import internals as _internals, interns as _interns, \
|
|
|
31
31
|
_isfrozen # DON'T _lazy_import2
|
|
32
32
|
# from pygeodesy.errors import _error_init, _xkwds_item2 # _ALL_MODS
|
|
33
33
|
from pygeodesy.internals import _caller3, _dunder_nameof, _dunder_ismain, \
|
|
34
|
-
_headof,
|
|
35
|
-
_tailof # _Property_RO
|
|
34
|
+
_headof, printf, _Pythonarchine, _tailof # _Property_RO
|
|
36
35
|
from pygeodesy.interns import NN, _attribute_, _by_, _COLONSPACE_, _COMMASPACE_, \
|
|
37
36
|
_doesn_t_exist_, _DOT_, _EQUALSPACED_, _from_, \
|
|
38
37
|
_HASH_, _immutable_, _line_, _module_, _no_, _not_, \
|
|
@@ -290,7 +289,7 @@ _ALL_LAZY = _NamedEnum_RO(_name='_ALL_LAZY',
|
|
|
290
289
|
geodesicx=_i('gx', 'gxarea', 'gxbases', 'gxline', # modules
|
|
291
290
|
'GeodesicAreaExact', 'GeodesicExact', 'GeodesicLineExact', 'PolygonArea'),
|
|
292
291
|
geodsolve=_i('GeodesicSolve', 'GeodesicLineSolve', 'GeodSolve12Tuple'),
|
|
293
|
-
geohash=_i('Geohash', 'GeohashError', 'Neighbors8Dict', 'Resolutions2Tuple'),
|
|
292
|
+
geohash=_i('Geohash', 'Geohashed', 'GeohashError', 'Neighbors8Dict', 'Resolutions2Tuple', 'Sizes3Tuple'),
|
|
294
293
|
geoids=_i('GeoidError', 'GeoidG2012B', 'GeoidKarney', 'GeoidPGM', 'egmGeoidHeights',
|
|
295
294
|
'PGMError', 'GeoidHeight5Tuple'),
|
|
296
295
|
hausdorff=_i('Hausdorff', 'HausdorffDegrees', 'HausdorffError', 'HausdorffRadians',
|
|
@@ -368,7 +367,7 @@ _ALL_LAZY = _NamedEnum_RO(_name='_ALL_LAZY',
|
|
|
368
367
|
triaxials=_i('BetaOmega2Tuple', 'BetaOmega3Tuple', 'Jacobi2Tuple',
|
|
369
368
|
'JacobiConformal', 'JacobiConformalSpherical',
|
|
370
369
|
'Triaxial', 'Triaxial_', 'TriaxialError', 'Triaxials', 'hartzell4'),
|
|
371
|
-
units=_i('Band', 'Bearing', 'Bearing_', 'Bool',
|
|
370
|
+
units=_i('Azimuth', 'Band', 'Bearing', 'Bearing_', 'Bool',
|
|
372
371
|
'Degrees', 'Degrees_', 'Degrees2', 'Distance', 'Distance_', 'Easting', 'Epoch',
|
|
373
372
|
'Feet', 'FIx', 'Float_', 'Height', 'Height_', 'HeightX', 'Int_',
|
|
374
373
|
'Lam', 'Lamd', 'Lat', 'Lat_', 'Lon', 'Lon_',
|
|
@@ -396,10 +395,10 @@ _ALL_LAZY = _NamedEnum_RO(_name='_ALL_LAZY',
|
|
|
396
395
|
utmups=_i('UtmUps', 'UTMUPSError', 'parseUTMUPS5', 'toUtmUps8',
|
|
397
396
|
'utmupsValidate', 'utmupsValidateOK', 'utmupsZoneBand5'),
|
|
398
397
|
utmupsBase=_i(), # module only
|
|
399
|
-
vector2d=_i('Circin6Tuple', 'Circum3Tuple', 'Circum4Tuple', 'Meeus2Tuple', 'Radii11Tuple', 'Soddy4Tuple',
|
|
400
|
-
'circin6', 'circum3', 'circum4_', 'meeus2', 'radii11', 'soddy4'),
|
|
398
|
+
vector2d=_i('Circin6Tuple', 'Circum3Tuple', 'Circum4Tuple', 'Meeus2Tuple', 'Radii11Tuple', 'Soddy4Tuple', 'Triaxum5Tuple',
|
|
399
|
+
'circin6', 'circum3', 'circum4', 'circum4_', 'meeus2', 'radii11', 'soddy4', 'triaxum5', 'trilaterate2d2'),
|
|
401
400
|
vector3d=_i('Vector3d', 'intersection3d3', 'iscolinearWith', 'nearestOn', 'nearestOn6', 'parse3d',
|
|
402
|
-
'
|
|
401
|
+
'trilaterate3d2'),
|
|
403
402
|
vector3dBase=_i(), # module only
|
|
404
403
|
webmercator=_i('Wm', 'WebMercatorError', 'parseWM', 'toWm', 'EasNorRadius3Tuple'),
|
|
405
404
|
wgrs=_i('Georef', 'WGRSError'),)
|
|
@@ -417,8 +416,8 @@ _ALL_DEPRECATED = _NamedEnum_RO(_name='_ALL_DEPRECATED',
|
|
|
417
416
|
deprecated_datum=_i('Curvature2Tuple', 'Datum', 'Ellipsoid', 'Transform', # assert
|
|
418
417
|
'Datums', 'Ellipsoids', 'Transforms',
|
|
419
418
|
'R_FM', 'R_KM', 'R_M', 'R_MA', 'R_MB', 'R_NM', 'R_SM', 'R_VM'),
|
|
420
|
-
deprecated_functions=_i('anStr', 'areaof', 'atand', 'bounds', # most of the DEPRECATED functions, except ...
|
|
421
|
-
'clipCS3', 'clipDMS', 'clipStr', 'collins', 'copysign', # ...
|
|
419
|
+
deprecated_functions=_i('anStr', 'areaof', 'atand', 'bounds', # most of the DEPRECATED functions, except ellipsoidal ...
|
|
420
|
+
'clipCS3', 'clipDMS', 'clipStr', 'collins', 'copysign', # ... and spherical flavors
|
|
422
421
|
'decodeEPSG2', 'encodeEPSG', 'enStr2', 'equirectangular_', 'equirectangular3',
|
|
423
422
|
'excessAbc', 'excessGirard', 'excessLHuilier',
|
|
424
423
|
'false2f', 'falsed2f', 'float0', 'fStr', 'fStrzs', 'hypot3',
|
|
@@ -522,7 +521,7 @@ class _ALL_MODS(_internals._MODS_Base):
|
|
|
522
521
|
_internals._MODS = _ALL_MODS = _ALL_MODS() # PYCHOK singleton
|
|
523
522
|
|
|
524
523
|
__all__ = _ALL_LAZY.lazily
|
|
525
|
-
__version__ = '24.
|
|
524
|
+
__version__ = '24.08.18'
|
|
526
525
|
|
|
527
526
|
|
|
528
527
|
def _ALL_OTHER(*objs):
|
|
@@ -862,13 +861,13 @@ def _lazy_module(name): # overwritten by _lazy_import2
|
|
|
862
861
|
#
|
|
863
862
|
# return _ALL_OTHER(*sm.values())
|
|
864
863
|
|
|
865
|
-
|
|
866
864
|
# del _i, _i0
|
|
867
865
|
|
|
868
866
|
# _ = _ALL_MODS.errors # force import pygeodesy.errors
|
|
869
867
|
|
|
870
868
|
if _dunder_ismain(__name__): # PYCHOK no cover
|
|
871
869
|
|
|
870
|
+
from pygeodesy.internals import _versions
|
|
872
871
|
from timeit import timeit
|
|
873
872
|
|
|
874
873
|
def t1():
|
|
@@ -882,22 +881,24 @@ if _dunder_ismain(__name__): # PYCHOK no cover
|
|
|
882
881
|
|
|
883
882
|
t1 = timeit(t1, number=1000000)
|
|
884
883
|
t2 = timeit(t2, number=1000000)
|
|
885
|
-
|
|
886
|
-
printf('%.6f import vs %.6f _ALL_MODS: %.2fX, %s', t1, t2, t1 / t2, v)
|
|
884
|
+
printf('%.6f import vs %.6f _ALL_MODS: %.2fX, %s', t1, t2, t1 / t2, _versions())
|
|
887
885
|
|
|
888
886
|
# del t1, t2, timeit, v
|
|
889
887
|
|
|
890
|
-
# python3.
|
|
891
|
-
# 0.
|
|
888
|
+
# % python3.13 -W ignore -m pygeodesy.lazily
|
|
889
|
+
# 0.102670 import vs 0.076113 _ALL_MODS: 1.35X, pygeodesy 24.8.4 Python 3.13.0b4 64bit arm64 macOS 14.5
|
|
890
|
+
|
|
891
|
+
# % python3.12 -W ignore -m pygeodesy.lazily
|
|
892
|
+
# 0.132801 import vs 0.079125 _ALL_MODS: 1.68X, pygeodesy 24.8.4 Python 3.12.4 64bit arm64 macOS 14.5
|
|
892
893
|
|
|
893
|
-
# python3.11 -W ignore -m pygeodesy.lazily
|
|
894
|
-
# 0.381723 import vs 0.251589 _ALL_MODS: 1.52X, Python 3.11.5 64bit arm64 macOS 14.4.1
|
|
894
|
+
# % python3.11 -W ignore -m pygeodesy.lazily
|
|
895
|
+
# 0.381723 import vs 0.251589 _ALL_MODS: 1.52X, pygeodesy 24.8.4 Python 3.11.5 64bit arm64 macOS 14.4.1
|
|
895
896
|
|
|
896
|
-
# python3.
|
|
897
|
-
# 0.
|
|
897
|
+
# % python3.8 -W ignore -m pygeodesy.lazily
|
|
898
|
+
# 0.570353 import vs 0.382842 _ALL_MODS: 1.49X, pygeodesy 24.8.4 Python 3.8.10 64bit arm64_x86_64 macOS 10.16
|
|
898
899
|
|
|
899
|
-
# python2 -m pygeodesy.lazily
|
|
900
|
-
# 1.213805 import vs 0.474075 _ALL_MODS: 2.56X, Python 2.7.18 64bit arm64_x86_64 macOS 10.16
|
|
900
|
+
# % python2 -m pygeodesy.lazily
|
|
901
|
+
# 1.213805 import vs 0.474075 _ALL_MODS: 2.56X, pygeodesy 24.8.4 Python 2.7.18 64bit arm64_x86_64 macOS 10.16
|
|
901
902
|
|
|
902
903
|
# **) MIT License
|
|
903
904
|
#
|
pygeodesy/ltp.py
CHANGED
|
@@ -44,7 +44,7 @@ from pygeodesy.vector3d import _ALL_LAZY, Vector3d
|
|
|
44
44
|
# from math import fabs, floor as _floor # from .fmath, .fsums
|
|
45
45
|
|
|
46
46
|
__all__ = _ALL_LAZY.ltp
|
|
47
|
-
__version__ = '24.
|
|
47
|
+
__version__ = '24.08.18'
|
|
48
48
|
|
|
49
49
|
_height0_ = _height_ + _0_
|
|
50
50
|
_narrow_ = 'narrow'
|
|
@@ -165,7 +165,7 @@ class Attitude(_NamedBase):
|
|
|
165
165
|
'''
|
|
166
166
|
try:
|
|
167
167
|
try:
|
|
168
|
-
xyz = map2(float, x_xyz.
|
|
168
|
+
xyz = map2(float, x_xyz.xyz3)
|
|
169
169
|
except AttributeError:
|
|
170
170
|
xyz = map1(float, x_xyz, y, z)
|
|
171
171
|
except (TypeError, ValueError) as x:
|
|
@@ -730,7 +730,7 @@ class _ChLV(object):
|
|
|
730
730
|
# assert _args_kwds_names( ChLV.reverse)[1:4] == t
|
|
731
731
|
# assert _args_kwds_names(ChLVa.reverse)[1:4] == t
|
|
732
732
|
# assert _args_kwds_names(ChLVe.reverse)[1:4] == t
|
|
733
|
-
return t # overwrite
|
|
733
|
+
return t # overwrite property_ROver
|
|
734
734
|
|
|
735
735
|
def forward(self, latlonh, lon=None, height=0, M=None, **name): # PYCHOK no cover
|
|
736
736
|
'''Convert WGS84 geodetic to I{Swiss} projection coordinates. I{Must be overloaded}.
|
|
@@ -876,7 +876,7 @@ class ChLV(_ChLV, Ltp):
|
|
|
876
876
|
|
|
877
877
|
@arg Y: Unfalsed I{Swiss Y} easting (C{meter}).
|
|
878
878
|
@arg X: Unfalsed I{Swiss X} northing (C{meter}).
|
|
879
|
-
@kwarg LV95: If C{True} add C{LV95} falsing, if C{False} add
|
|
879
|
+
@kwarg LV95: If C{True}, add C{LV95} falsing, if C{False} add
|
|
880
880
|
C{LV03} falsing, otherwise leave unfalsed.
|
|
881
881
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
882
882
|
|
|
@@ -928,9 +928,8 @@ class ChLV(_ChLV, Ltp):
|
|
|
928
928
|
|
|
929
929
|
@arg e: Falsed I{Swiss E_LV95} or I{y_LV03} easting (C{meter}).
|
|
930
930
|
@arg n: Falsed I{Swiss N_LV95} or I{x_LV03} northing (C{meter}).
|
|
931
|
-
@kwarg LV95: If C{True} remove I{LV95} falsing, if C{False} remove
|
|
932
|
-
I{LV03} falsing, otherwise use method C{isLV95(B{e},
|
|
933
|
-
B{n})}.
|
|
931
|
+
@kwarg LV95: If C{True}, remove I{LV95} falsing, if C{False} remove
|
|
932
|
+
I{LV03} falsing, otherwise use method C{isLV95(B{e}, B{n})}.
|
|
934
933
|
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
935
934
|
|
|
936
935
|
@return: A L{ChLVYX2Tuple}C{(Y, X)} with the unfalsed B{C{e}}
|
pygeodesy/ltpTuples.py
CHANGED
|
@@ -28,15 +28,15 @@ from pygeodesy.namedTuples import LatLon2Tuple, PhiLam2Tuple, Vector3Tuple
|
|
|
28
28
|
from pygeodesy.props import deprecated_method, deprecated_Property_RO, \
|
|
29
29
|
Property_RO, property_RO
|
|
30
30
|
from pygeodesy.streprs import Fmt, fstr, strs, _xzipairs
|
|
31
|
-
from pygeodesy.units import Bearing, Degrees, Degrees_, Height,
|
|
32
|
-
_isMeter, Lat, Lon, Meter, Meter_
|
|
31
|
+
from pygeodesy.units import Azimuth, Bearing, Degrees, Degrees_, Height, \
|
|
32
|
+
_isDegrees, _isMeter, Lat, Lon, Meter, Meter_
|
|
33
33
|
from pygeodesy.utily import atan2d, atan2b, sincos2_, sincos2d_, cos, radians
|
|
34
34
|
from pygeodesy.vector3d import Vector3d
|
|
35
35
|
|
|
36
36
|
# from math import cos, radians # from .utily
|
|
37
37
|
|
|
38
38
|
__all__ = _ALL_LAZY.ltpTuples
|
|
39
|
-
__version__ = '24.
|
|
39
|
+
__version__ = '24.08.18'
|
|
40
40
|
|
|
41
41
|
_aer_ = 'aer'
|
|
42
42
|
_alt_ = 'alt'
|
|
@@ -93,7 +93,7 @@ def _xyz2aer4(inst):
|
|
|
93
93
|
'''(INTERNAL) Convert C{(x, y, z}) to C{(A, E, R)}.
|
|
94
94
|
'''
|
|
95
95
|
x, y, z, _ = inst.xyz4
|
|
96
|
-
A =
|
|
96
|
+
A = Azimuth(atan2b(x, y))
|
|
97
97
|
E = Degrees(elevation=atan2d(z, hypot(x, y)))
|
|
98
98
|
R = Meter(slantrange=hypot_(x, y, z))
|
|
99
99
|
return Aer4Tuple(A, E, R, inst.ltp, name=inst.name)
|
|
@@ -189,6 +189,12 @@ class _AbcBase(_NamedBase):
|
|
|
189
189
|
'''
|
|
190
190
|
return Vector3Tuple(self.x, self.y, self.z, name=self.name) # like Ecef9Tuple.xyz, Local6tuple.xyz
|
|
191
191
|
|
|
192
|
+
@property_RO
|
|
193
|
+
def xyz3(self):
|
|
194
|
+
'''Get the I{local} C{(X, Y, Z)} coordinates as C{3-tuple}.
|
|
195
|
+
'''
|
|
196
|
+
return tuple(self.xyz)
|
|
197
|
+
|
|
192
198
|
@property_RO
|
|
193
199
|
def xyz4(self): # PYCHOK no cover
|
|
194
200
|
'''I{Must be overloaded}.'''
|
|
@@ -268,7 +274,7 @@ class Aer(_AbcBase):
|
|
|
268
274
|
'''
|
|
269
275
|
if _isDegrees(azimuth_aer):
|
|
270
276
|
aer = None
|
|
271
|
-
t = (
|
|
277
|
+
t = (Azimuth(azimuth_aer),
|
|
272
278
|
Degrees_(elevation=elevation, low=_N_90_0, high=_90_0),
|
|
273
279
|
Meter_(slantrange=slantrange), ltp)
|
|
274
280
|
else: # PYCHOK no cover
|
|
@@ -421,7 +427,7 @@ class Attitude4Tuple(_NamedTuple):
|
|
|
421
427
|
the attitude of a plane or camera.
|
|
422
428
|
'''
|
|
423
429
|
_Names_ = (_alt_, _tilt_, _yaw_, _roll_)
|
|
424
|
-
_Units_ = ( Meter,
|
|
430
|
+
_Units_ = ( Meter, Degrees, Bearing, Degrees)
|
|
425
431
|
|
|
426
432
|
@Property_RO
|
|
427
433
|
def atyr(self):
|
pygeodesy/named.py
CHANGED
|
@@ -34,7 +34,7 @@ from pygeodesy.streprs import attrs, Fmt, lrstrip, pairs, reprs, unstr
|
|
|
34
34
|
# from pygeodesy.units import _toUnit # _MODS
|
|
35
35
|
|
|
36
36
|
__all__ = _ALL_LAZY.named
|
|
37
|
-
__version__ = '24.
|
|
37
|
+
__version__ = '24.08.13'
|
|
38
38
|
|
|
39
39
|
_COMMANL_ = _COMMA_ + _NL_
|
|
40
40
|
_COMMASPACEDOT_ = _COMMASPACE_ + _DOT_
|
|
@@ -214,8 +214,8 @@ class _Named(object):
|
|
|
214
214
|
def copy(self, deep=False, **name):
|
|
215
215
|
'''Make a shallow or deep copy of this instance.
|
|
216
216
|
|
|
217
|
-
@kwarg deep: If C{True} make a deep, otherwise
|
|
218
|
-
|
|
217
|
+
@kwarg deep: If C{True}, make a deep, otherwise a shallow
|
|
218
|
+
copy (C{bool}).
|
|
219
219
|
@kwarg name: Optional, non-empty C{B{name}=NN} (C{str}).
|
|
220
220
|
|
|
221
221
|
@return: The copy (C{This class}).
|
|
@@ -233,7 +233,8 @@ class _Named(object):
|
|
|
233
233
|
def dup(self, deep=False, **items):
|
|
234
234
|
'''Duplicate this instance, replacing some attributes.
|
|
235
235
|
|
|
236
|
-
@kwarg deep: If C{True} duplicate deep, otherwise shallow
|
|
236
|
+
@kwarg deep: If C{True}, duplicate deep, otherwise shallow
|
|
237
|
+
(C{bool}).
|
|
237
238
|
@kwarg items: Attributes to be changed (C{any}), including
|
|
238
239
|
optional C{B{name}} (C{str}).
|
|
239
240
|
|
pygeodesy/namedTuples.py
CHANGED
|
@@ -28,7 +28,7 @@ from pygeodesy.units import Band, Bearing, Degrees, Degrees2, Easting, FIx, \
|
|
|
28
28
|
Radius, Scalar, Str, INT0
|
|
29
29
|
|
|
30
30
|
__all__ = _ALL_LAZY.namedTuples
|
|
31
|
-
__version__ = '24.
|
|
31
|
+
__version__ = '24.08.18'
|
|
32
32
|
|
|
33
33
|
# __DUNDER gets mangled in class
|
|
34
34
|
_closest_ = 'closest'
|
|
@@ -676,6 +676,12 @@ class Vector3Tuple(_NamedTuple):
|
|
|
676
676
|
'''
|
|
677
677
|
return self
|
|
678
678
|
|
|
679
|
+
@property_RO
|
|
680
|
+
def xyz3(self):
|
|
681
|
+
'''Get X, Y and Z components as C{3-tuple}.
|
|
682
|
+
'''
|
|
683
|
+
return tuple(self)
|
|
684
|
+
|
|
679
685
|
|
|
680
686
|
class Vector4Tuple(_NamedTuple): # .nvector.py
|
|
681
687
|
'''4-Tuple C{(x, y, z, h)} of (geocentric) components, all
|
|
@@ -697,6 +703,13 @@ class Vector4Tuple(_NamedTuple): # .nvector.py
|
|
|
697
703
|
'''
|
|
698
704
|
return Vector3Tuple(*self[:3])
|
|
699
705
|
|
|
706
|
+
@property_RO
|
|
707
|
+
def xyz3(self):
|
|
708
|
+
'''Get X, Y and Z components as C{3-tuple}.
|
|
709
|
+
'''
|
|
710
|
+
return tuple(self[:3])
|
|
711
|
+
|
|
712
|
+
|
|
700
713
|
# **) MIT License
|
|
701
714
|
#
|
|
702
715
|
# Copyright (C) 2016-2024 -- mrJean1 at Gmail -- All Rights Reserved.
|
pygeodesy/osgr.py
CHANGED
|
@@ -53,7 +53,7 @@ from pygeodesy.utily import degrees90, degrees180, sincostan3, truncate
|
|
|
53
53
|
from math import cos, fabs, radians, sin, sqrt
|
|
54
54
|
|
|
55
55
|
__all__ = _ALL_LAZY.osgr
|
|
56
|
-
__version__ = '24.
|
|
56
|
+
__version__ = '24.08.13'
|
|
57
57
|
|
|
58
58
|
_equivalent_ = 'equivalent'
|
|
59
59
|
_OSGR_ = 'OSGR'
|
|
@@ -289,9 +289,9 @@ class Osgr(_NamedBase):
|
|
|
289
289
|
@kwarg datum: Optional datum to convert to (L{Datum},
|
|
290
290
|
L{Ellipsoid}, L{Ellipsoid2}, L{Ellipsoid2}
|
|
291
291
|
or L{a_f2Tuple}).
|
|
292
|
-
@kwarg kTM: If C{True} use I{Karney}'s Krüger method from
|
|
293
|
-
module L{ktm}, otherwise use the Ordnance
|
|
294
|
-
|
|
292
|
+
@kwarg kTM: If C{True}, use I{Karney}'s Krüger method from
|
|
293
|
+
module L{ktm}, otherwise use the Ordnance Survey
|
|
294
|
+
formulation (C{bool}).
|
|
295
295
|
@kwarg eps: Tolerance for OS convergence (C{meter}).
|
|
296
296
|
@kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
|
|
297
297
|
arguments, ignored if C{B{LatLon} is None}.
|
|
@@ -585,9 +585,9 @@ def toOsgr(latlon, lon=None, kTM=False, datum=_WGS84, Osgr=Osgr, # MCCABE 14
|
|
|
585
585
|
@arg latlon: Latitude (C{degrees}) or an (ellipsoidal) geodetic
|
|
586
586
|
C{LatLon} point.
|
|
587
587
|
@kwarg lon: Optional longitude in degrees (scalar or C{None}).
|
|
588
|
-
@kwarg kTM: If C{True} use I{Karney}'s Krüger method from
|
|
589
|
-
module L{ktm}, otherwise use the Ordnance
|
|
590
|
-
|
|
588
|
+
@kwarg kTM: If C{True}, use I{Karney}'s Krüger method from
|
|
589
|
+
module L{ktm}, otherwise use the Ordnance Survey
|
|
590
|
+
formulation (C{bool}).
|
|
591
591
|
@kwarg datum: Optional datum to convert B{C{lat, lon}} from
|
|
592
592
|
(L{Datum}, L{Ellipsoid}, L{Ellipsoid2} or
|
|
593
593
|
L{a_f2Tuple}).
|
pygeodesy/points.py
CHANGED
|
@@ -62,7 +62,7 @@ from pygeodesy.utily import atan2b, degrees90, degrees180, degrees2m, \
|
|
|
62
62
|
from math import cos, fabs, fmod as _fmod, radians, sin
|
|
63
63
|
|
|
64
64
|
__all__ = _ALL_LAZY.points
|
|
65
|
-
__version__ = '24.
|
|
65
|
+
__version__ = '24.08.13'
|
|
66
66
|
|
|
67
67
|
_ilat_ = 'ilat'
|
|
68
68
|
_ilon_ = 'ilon'
|
|
@@ -217,7 +217,7 @@ class _Basequence(_Sequence): # immutable, on purpose
|
|
|
217
217
|
def copy(self, deep=False): # PYCHOK no cover
|
|
218
218
|
'''Make a shallow or deep copy of this instance.
|
|
219
219
|
|
|
220
|
-
@kwarg deep: If C{True} make a deep, otherwise a
|
|
220
|
+
@kwarg deep: If C{True}, make a deep, otherwise a
|
|
221
221
|
shallow copy (C{bool}).
|
|
222
222
|
|
|
223
223
|
@return: The copy (C{This class}).
|
pygeodesy/resections.py
CHANGED
|
@@ -34,7 +34,7 @@ from pygeodesy.vector3d import _otherV3d, Vector3d
|
|
|
34
34
|
from math import cos, atan2, degrees, fabs, radians, sin, sqrt
|
|
35
35
|
|
|
36
36
|
__all__ = _ALL_LAZY.resections
|
|
37
|
-
__version__ = '24.
|
|
37
|
+
__version__ = '24.08.18'
|
|
38
38
|
|
|
39
39
|
_concyclic_ = 'concyclic'
|
|
40
40
|
_PA_ = 'PA'
|
|
@@ -356,8 +356,8 @@ def pierlot(point1, point2, point3, alpha12, alpha23, useZ=False, eps=EPS,
|
|
|
356
356
|
def _pierlot3(B1, B2, B3, a12, a23, useZ, cot):
|
|
357
357
|
'''(INTERNAL) Shared L{pierlot} and L{pierlotx}.
|
|
358
358
|
'''
|
|
359
|
-
x1_, y1_, _ = B1.minus(B2).
|
|
360
|
-
x3_, y3_, _ = B3.minus(B2).
|
|
359
|
+
x1_, y1_, _ = B1.minus(B2).xyz3
|
|
360
|
+
x3_, y3_, _ = B3.minus(B2).xyz3
|
|
361
361
|
|
|
362
362
|
s12, c12, s23, c23 = sincos2d_(a12, a23)
|
|
363
363
|
# cot31 = (1 - cot12 * cot23) / (cot12 + cot32)
|
|
@@ -402,7 +402,7 @@ def _pierlot3(B1, B2, B3, a12, a23, useZ, cot):
|
|
|
402
402
|
x, y = _pierlotxy2(B2, -K, Y12_23, X12_23, (X31_23 * Y12_23 -
|
|
403
403
|
X12_23 * Y31_23))
|
|
404
404
|
else:
|
|
405
|
-
x, y, _ = B2.
|
|
405
|
+
x, y, _ = B2.xyz3
|
|
406
406
|
return x, y, _zidw(x, y, useZ, B1, B2, B3)
|
|
407
407
|
|
|
408
408
|
|
|
@@ -484,8 +484,8 @@ def _pierlotx3(a_z_Bs, useZ, cot, Cs):
|
|
|
484
484
|
Cs(4)
|
|
485
485
|
return _pierlot3(B1, B2, B3, a12, a23, useZ, cot)
|
|
486
486
|
|
|
487
|
-
x1_, y1_, _ = B1.minus(B3).
|
|
488
|
-
x2_, y2_, _ = B2.minus(B3).
|
|
487
|
+
x1_, y1_, _ = B1.minus(B3).xyz3
|
|
488
|
+
x2_, y2_, _ = B2.minus(B3).xyz3
|
|
489
489
|
|
|
490
490
|
K = _Fsumf_(y1_ * x2_, -x1_ * y2_)
|
|
491
491
|
if K:
|
|
@@ -508,7 +508,7 @@ def _pierlotx3(a_z_Bs, useZ, cot, Cs):
|
|
|
508
508
|
x, y = _pierlotxy2(B3, K, Y31_23, X31_23, (X31_23 * _Fsumf_(x2_, -x1_) +
|
|
509
509
|
Y31_23 * _Fsumf_(y2_, -y1_)))
|
|
510
510
|
else:
|
|
511
|
-
x, y, _ = B3.
|
|
511
|
+
x, y, _ = B3.xyz3
|
|
512
512
|
return x, y, _zidw(x, y, useZ, B1, B2, B3)
|
|
513
513
|
|
|
514
514
|
|
pygeodesy/rhumb/solve.py
CHANGED
|
@@ -21,7 +21,7 @@ from pygeodesy.solveBase import _SolveGDictBase, _SolveGDictLineBase
|
|
|
21
21
|
from pygeodesy.utily import _unrollon, _Wrap, wrap360
|
|
22
22
|
|
|
23
23
|
__all__ = _ALL_LAZY.rhumb_solve
|
|
24
|
-
__version__ = '24.
|
|
24
|
+
__version__ = '24.08.13'
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class _RhumbSolveBase(_SolveGDictBase):
|
|
@@ -94,8 +94,8 @@ class RhumbSolve(_RhumbSolveBase):
|
|
|
94
94
|
# '''Set up a L{RhumbArea} to compute area and
|
|
95
95
|
# perimeter of a polygon.
|
|
96
96
|
#
|
|
97
|
-
# @kwarg polyline: If C{True} perimeter only,
|
|
98
|
-
#
|
|
97
|
+
# @kwarg polyline: If C{True}, compute the perimeter only,
|
|
98
|
+
# otherwise perimeter and area (C{bool}).
|
|
99
99
|
# @kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
100
100
|
#
|
|
101
101
|
# @return: A L{RhumbArea} instance.
|