pygeodesy 25.4.8__py2.py3-none-any.whl → 25.5.5__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.
Files changed (97) hide show
  1. pygeodesy/__init__.py +36 -31
  2. pygeodesy/__main__.py +3 -3
  3. pygeodesy/albers.py +29 -36
  4. pygeodesy/auxilats/_CX_4.py +2 -2
  5. pygeodesy/auxilats/_CX_6.py +2 -2
  6. pygeodesy/auxilats/_CX_8.py +2 -2
  7. pygeodesy/auxilats/_CX_Rs.py +9 -9
  8. pygeodesy/auxilats/__init__.py +3 -3
  9. pygeodesy/auxilats/__main__.py +8 -6
  10. pygeodesy/auxilats/auxAngle.py +2 -2
  11. pygeodesy/auxilats/auxLat.py +5 -5
  12. pygeodesy/auxilats/auxily.py +5 -3
  13. pygeodesy/azimuthal.py +7 -6
  14. pygeodesy/basics.py +32 -18
  15. pygeodesy/booleans.py +18 -16
  16. pygeodesy/cartesianBase.py +26 -24
  17. pygeodesy/clipy.py +11 -10
  18. pygeodesy/constants.py +11 -10
  19. pygeodesy/css.py +14 -11
  20. pygeodesy/datums.py +8 -8
  21. pygeodesy/deprecated/bases.py +2 -2
  22. pygeodesy/deprecated/classes.py +2 -2
  23. pygeodesy/deprecated/consterns.py +4 -4
  24. pygeodesy/dms.py +8 -8
  25. pygeodesy/ecef.py +22 -29
  26. pygeodesy/ecefLocals.py +186 -0
  27. pygeodesy/elevations.py +9 -8
  28. pygeodesy/ellipsoidalBase.py +19 -8
  29. pygeodesy/ellipsoidalBaseDI.py +17 -15
  30. pygeodesy/ellipsoidalNvector.py +6 -3
  31. pygeodesy/ellipsoidalVincenty.py +4 -1
  32. pygeodesy/ellipsoids.py +186 -164
  33. pygeodesy/elliptic.py +9 -9
  34. pygeodesy/errors.py +44 -43
  35. pygeodesy/etm.py +7 -7
  36. pygeodesy/fmath.py +30 -14
  37. pygeodesy/formy.py +11 -12
  38. pygeodesy/frechet.py +216 -109
  39. pygeodesy/fstats.py +5 -4
  40. pygeodesy/fsums.py +79 -78
  41. pygeodesy/gars.py +4 -3
  42. pygeodesy/geodesici.py +15 -14
  43. pygeodesy/geodesicw.py +34 -32
  44. pygeodesy/geodesicx/__init__.py +1 -1
  45. pygeodesy/geodesicx/__main__.py +11 -9
  46. pygeodesy/geodesicx/gx.py +30 -33
  47. pygeodesy/geodesicx/gxarea.py +2 -2
  48. pygeodesy/geodesicx/gxline.py +5 -5
  49. pygeodesy/geodsolve.py +18 -17
  50. pygeodesy/geohash.py +5 -5
  51. pygeodesy/geoids.py +34 -31
  52. pygeodesy/hausdorff.py +17 -13
  53. pygeodesy/heights.py +2 -4
  54. pygeodesy/internals.py +28 -44
  55. pygeodesy/interns.py +10 -7
  56. pygeodesy/iters.py +8 -8
  57. pygeodesy/karney.py +68 -62
  58. pygeodesy/ktm.py +5 -5
  59. pygeodesy/latlonBase.py +20 -21
  60. pygeodesy/lazily.py +104 -78
  61. pygeodesy/lcc.py +11 -9
  62. pygeodesy/ltp.py +56 -58
  63. pygeodesy/ltpTuples.py +35 -36
  64. pygeodesy/mgrs.py +7 -6
  65. pygeodesy/named.py +48 -177
  66. pygeodesy/nvectorBase.py +7 -7
  67. pygeodesy/osgr.py +9 -8
  68. pygeodesy/points.py +12 -10
  69. pygeodesy/props.py +25 -25
  70. pygeodesy/resections.py +83 -80
  71. pygeodesy/rhumb/__init__.py +1 -1
  72. pygeodesy/rhumb/aux_.py +7 -7
  73. pygeodesy/rhumb/bases.py +22 -20
  74. pygeodesy/rhumb/ekx.py +6 -6
  75. pygeodesy/rhumb/solve.py +15 -15
  76. pygeodesy/solveBase.py +3 -3
  77. pygeodesy/sphericalBase.py +6 -6
  78. pygeodesy/sphericalNvector.py +6 -5
  79. pygeodesy/sphericalTrigonometry.py +8 -7
  80. pygeodesy/streprs.py +14 -14
  81. pygeodesy/trf.py +14 -12
  82. pygeodesy/triaxials.py +29 -26
  83. pygeodesy/units.py +5 -4
  84. pygeodesy/unitsBase.py +5 -4
  85. pygeodesy/ups.py +3 -3
  86. pygeodesy/utily.py +4 -4
  87. pygeodesy/utmups.py +4 -4
  88. pygeodesy/utmupsBase.py +110 -18
  89. pygeodesy/vector2d.py +20 -13
  90. pygeodesy/vector3d.py +7 -6
  91. pygeodesy/webmercator.py +6 -5
  92. pygeodesy/wgrs.py +6 -5
  93. {pygeodesy-25.4.8.dist-info → pygeodesy-25.5.5.dist-info}/METADATA +30 -25
  94. pygeodesy-25.5.5.dist-info/RECORD +119 -0
  95. pygeodesy-25.4.8.dist-info/RECORD +0 -118
  96. {pygeodesy-25.4.8.dist-info → pygeodesy-25.5.5.dist-info}/WHEEL +0 -0
  97. {pygeodesy-25.4.8.dist-info → pygeodesy-25.5.5.dist-info}/top_level.txt +0 -0
pygeodesy/karney.py CHANGED
@@ -143,18 +143,19 @@ in C{pygeodesy} are based on I{Karney}'s post U{Area of a spherical polygon
143
143
  # make sure int/int division yields float quotient, see .basics
144
144
  from __future__ import division as _; del _ # PYCHOK semicolon
145
145
 
146
- from pygeodesy.basics import _copysign, isint, neg, unsigned0, \
146
+ from pygeodesy.basics import _copysign, _isin, isint, neg, unsigned0, \
147
147
  _xgeographiclib, _zip
148
148
  from pygeodesy.constants import NAN, _isfinite as _math_isfinite, _0_0, \
149
149
  _1_16th, _1_0, _2_0, _180_0, _N_180_0, _360_0
150
150
  from pygeodesy.errors import GeodesicError, _ValueError, _xkwds
151
151
  from pygeodesy.fmath import cbrt, fremainder, norm2 # Fhorner, Fsum
152
- from pygeodesy.internals import _getenv, _popen2, _PYGEODESY, _version_info
152
+ from pygeodesy.internals import _getenv, _popen2, _PYGEODESY_ENV, typename, \
153
+ _version_info
153
154
  from pygeodesy.interns import NN, _a12_, _area_, _azi1_, _azi2_, _azi12_, \
154
155
  _composite_, _lat1_, _lat2_, _lon1_, _lon2_, \
155
156
  _m12_, _M12_, _M21_, _number_, _s12_, _S12_, \
156
157
  _SPACE_, _UNDER_, _X_, _1_, _2_, _BAR_ # PYCHOK used!
157
- from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
158
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, _FOR_DOCS
158
159
  from pygeodesy.named import ADict, _NamedBase, _NamedTuple, notImplemented, _Pass
159
160
  from pygeodesy.props import deprecated_method, Property_RO, property_RO, \
160
161
  property_ROnce
@@ -165,10 +166,10 @@ from pygeodesy.utily import atan2d, sincos2d, tand, _unrollon, fabs
165
166
  # from math import fabs # from .utily
166
167
 
167
168
  __all__ = _ALL_LAZY.karney
168
- __version__ = '25.04.08'
169
+ __version__ = '25.04.14'
169
170
 
170
171
  _2_4_ = '2.4'
171
- _K_2_0 = _getenv(_PYGEODESY(_xgeographiclib, 1), _2_)
172
+ _K_2_0 = _getenv(_PYGEODESY_ENV(typename(_xgeographiclib)[2:]), _2_)
172
173
  _K_2_4 = _K_2_0 == _2_4_
173
174
  _K_2_0 = _K_2_4 or (_K_2_0 == _2_)
174
175
  _perimeter_ = 'perimeter'
@@ -216,7 +217,38 @@ class Area3Tuple(_NamedTuple): # in .geodesicx.gxarea
216
217
 
217
218
 
218
219
  class Caps(object):
219
- '''(INTERNAL) Overriden by C{Caps} below.
220
+ '''I{Enum}-style masks to be bit-C{or}'ed to specify C{geodesic}, C{rhumb}
221
+ or C{-lines} capabilities (C{caps}) and method results (C{outmask}).
222
+
223
+ C{AREA} - compute the area C{S12},
224
+
225
+ C{AZIMUTH} - include azimuths C{azi1} and C{azi2},
226
+
227
+ C{DISTANCE} - compute distance C{s12} and angular distance C{a12},
228
+
229
+ C{DISTANCE_IN} - allow distance C{s12} in method C{.Direct},
230
+
231
+ C{EMPTY} - nothing, formerly aka C{NONE},
232
+
233
+ C{GEODESICSCALE} - compute geodesic scales C{M12} and C{M21},
234
+
235
+ C{LATITUDE} - compute latitude C{lat2},
236
+
237
+ C{LINE_OFF} - Line without updates from parent C{geodesic} or C{rhumb}.
238
+
239
+ C{LONGITUDE} - compute longitude C{lon2},
240
+
241
+ C{LONG_UNROLL} - unroll C{lon2} in method C{.Direct},
242
+
243
+ C{REDUCEDLENGTH} - compute the reduced length C{m12},
244
+
245
+ C{REVERSE2} - reverse azimuth C{azi2} by 180 degrees,
246
+
247
+ and C{ALL} - all of the above.
248
+
249
+ C{STANDARD} = C{AZIMUTH | DISTANCE | LATITUDE | LONGITUDE}
250
+
251
+ C{LINE_CAPS} = C{STANDARD | DISTANCE_IN | REDUCEDLENGTH | GEODESICSCALE}
220
252
  '''
221
253
  EMPTY = 0 # formerly aka NONE
222
254
  _CAP_1 = 1 << 0 # for goedesici/-w
@@ -224,6 +256,8 @@ class Caps(object):
224
256
  _CAP_2 = 1 << 2
225
257
  _CAP_3 = 1 << 3 # for goedesici/-w
226
258
  _CAP_4 = 1 << 4 # for goedesicw
259
+ # = 1 << 5 # unused
260
+ # = 1 << 6 # unused
227
261
  _CAP_ALL = 0x1F
228
262
  # _CAP_MASK = _CAP_ALL
229
263
  LATITUDE = 1 << 7 # compute latitude C{lat2}
@@ -235,25 +269,21 @@ class Caps(object):
235
269
  GEODESICSCALE = 1 << 13 | _CAP_1 | _CAP_2 # compute geodesic scales C{M12} and C{M21}
236
270
  AREA = 1 << 14 | _CAP_4 # compute area C{S12}
237
271
 
238
- STANDARD = AZIMUTH | DISTANCE | LATITUDE | LONGITUDE
239
-
240
- _DIRECT3 = AZIMUTH | LATITUDE | LONGITUDE # for goedesicw only
241
- _INVERSE3 = AZIMUTH | DISTANCE # for goedesicw only
242
- _STD = STANDARD # for goedesicw only
243
- _STD_LINE = _STD | DISTANCE_IN # for goedesici/-w
272
+ STANDARD = AZIMUTH | DISTANCE | LATITUDE | LONGITUDE
273
+ STANDARD_LINE = STANDARD | DISTANCE_IN # for goedesici/-w
244
274
 
245
- LINE_CAPS = _STD_LINE | REDUCEDLENGTH | GEODESICSCALE # .geodesici only
275
+ LINE_CAPS = STANDARD_LINE | REDUCEDLENGTH | GEODESICSCALE # .geodesici only
246
276
  LONG_UNROLL = 1 << 15 # unroll C{lon2} in .Direct and .Position
247
277
  # = 1 << 16 # unused
248
278
  LINE_OFF = 1 << 17 # Line without updates from parent geodesic or rhumb
249
279
  REVERSE2 = 1 << 18 # reverse C{azi2}
250
280
  ALL = 0x7F80 | _CAP_ALL # without LONG_UNROLL, LINE_OFF, REVERSE2 and _DEBUG_*
251
281
 
252
- LATITUDE_LONGITUDE = LATITUDE | LONGITUDE
253
- LATITUDE_LONGITUDE_AREA = LATITUDE | LONGITUDE | AREA
282
+ AZIMUTH_DISTANCE = AZIMUTH | DISTANCE
283
+ AZIMUTH_DISTANCE_AREA = AZIMUTH | DISTANCE | AREA
254
284
 
255
- AZIMUTH_DISTANCE = AZIMUTH | DISTANCE
256
- AZIMUTH_DISTANCE_AREA = AZIMUTH | DISTANCE | AREA
285
+ LATITUDE_LONGITUDE = LATITUDE | LONGITUDE
286
+ LATITUDE_LONGITUDE_AREA = LATITUDE | LONGITUDE | AREA
257
287
 
258
288
  _SALP_CALPs_ = 1 << 19 # (INTERNAL) GeodesicExact._GenInverse
259
289
 
@@ -264,6 +294,9 @@ class Caps(object):
264
294
  _DEBUG_ALL = _DEBUG_AREA | _DEBUG_DIRECT | _DEBUG_INVERSE | \
265
295
  _DEBUG_LINE | _SALP_CALPs_
266
296
 
297
+ _DIRECT3 = AZIMUTH | LATITUDE | LONGITUDE # for goedesicw only
298
+ _INVERSE3 = AZIMUTH | DISTANCE # for goedesicw only
299
+
267
300
  _OUT_ALL = ALL # see geographiclib.geodesiccapabilities.py
268
301
  _OUT_MASK = ALL | LONG_UNROLL | REVERSE2 | _DEBUG_ALL
269
302
 
@@ -277,7 +310,7 @@ class Caps(object):
277
310
  def items(self):
278
311
  '''Yield all I{public} C{Caps} as 2-tuple C{(NAME, mask)}.
279
312
  '''
280
- for n, C in Caps.__class__.__dict__.items():
313
+ for n, C in type(self).__dict__.items():
281
314
  if isint(C) and not n.startswith(_UNDER_) \
282
315
  and n.replace(_UNDER_, NN).isupper():
283
316
  yield n, C
@@ -289,37 +322,10 @@ class Caps(object):
289
322
  if C and (Cask & C) == C) # and int1s(C) <= 3
290
323
  return sep.join(s) if sep else tuple(s)
291
324
 
292
- Caps = Caps() # PYCHOK singleton
293
- '''I{Enum}-style masks to be bit-C{or}'ed to specify geodesic or
294
- rhumb capabilities (C{caps}) and results (C{outmask}).
295
-
296
- C{AREA} - compute area C{S12},
297
-
298
- C{AZIMUTH} - include azimuths C{azi1} and C{azi2},
299
-
300
- C{DISTANCE} - compute distance C{s12} and angular distance C{a12},
301
-
302
- C{DISTANCE_IN} - allow distance C{s12} in C{.Direct},
303
-
304
- C{EMPTY} - nothing, formerly aka C{NONE},
305
-
306
- C{GEODESICSCALE} - compute geodesic scales C{M12} and C{M21},
307
-
308
- C{LATITUDE} - compute latitude C{lat2},
309
-
310
- C{LINE_OFF} - Line without updates from parent geodesic or rhumb.
311
-
312
- C{LONGITUDE} - compute longitude C{lon2},
313
-
314
- C{LONG_UNROLL} - unroll C{lon2} in C{.Direct},
315
-
316
- C{REDUCEDLENGTH} - compute reduced length C{m12},
317
-
318
- C{REVERSE2} - reverse C{azi2},
319
-
320
- and C{ALL} - all of the above.
321
-
322
- C{STANDARD} = C{AZIMUTH | DISTANCE | DISTANCE_IN | LATITUDE | LONGITUDE}'''
325
+ if _FOR_DOCS: # PYCHOK force ...
326
+ pass # ... CAPS.__doc__ into epydoc
327
+ else:
328
+ Caps = Caps() # PYCHOK singleton
323
329
 
324
330
  _key2Caps = dict(a12 =Caps.DISTANCE, # in GDict._unCaps
325
331
  azi2=Caps.AZIMUTH,
@@ -349,7 +355,7 @@ class _CapsBase(_NamedBase): # in .auxilats, .geodesicx.gxbases
349
355
  LONG_UNROLL = Caps.LONG_UNROLL
350
356
  REDUCEDLENGTH = Caps.REDUCEDLENGTH
351
357
  STANDARD = Caps.STANDARD
352
- _STD_LINE = Caps._STD_LINE # for geodesici
358
+ STANDARD_LINE = Caps.STANDARD_LINE # for geodesici
353
359
 
354
360
  _caps = 0 # None
355
361
  _debug = 0 # or Caps._DEBUG_...
@@ -363,11 +369,11 @@ class _CapsBase(_NamedBase): # in .auxilats, .geodesicx.gxbases
363
369
  def caps_(self, caps):
364
370
  '''Check the available capabilities.
365
371
 
366
- @arg caps: Bit-or'ed combination of L{Caps} values
367
- for all capabilities to be checked.
372
+ @arg caps: Bit-or'ed combination of L{Caps<pygeodesy.karney.Caps>}
373
+ values for all capabilities to be checked.
368
374
 
369
- @return: C{True} if I{all} B{C{caps}} are available,
370
- C{False} otherwise (C{bool}).
375
+ @return: C{True} if I{all} B{C{caps}} are available, C{False}
376
+ otherwise (C{bool}).
371
377
  '''
372
378
  caps &= Caps._OUT_ALL
373
379
  return (self.caps & caps) == caps
@@ -538,7 +544,7 @@ class Inverse10Tuple(_GTuple):
538
544
 
539
545
 
540
546
  class _kWrapped(object): # in .geodesicw
541
- ''''(INTERNAL) Wrapper for some of I{Karney}'s U{geographiclib
547
+ '''(INTERNAL) Wrapper for some of I{Karney}'s U{geographiclib
542
548
  <https://PyPI.org/project/geographiclib>} classes.
543
549
  '''
544
550
 
@@ -548,7 +554,7 @@ class _kWrapped(object): # in .geodesicw
548
554
  <https://PyPI.org/project/geographiclib>} package is installed,
549
555
  otherwise raise a C{LazyImportError}.
550
556
  '''
551
- g = _xgeographiclib(self.__class__.__module__, 1, 49)
557
+ g = _xgeographiclib(type(self).__module__, 1, 49)
552
558
  from geographiclib.geodesic import Geodesic
553
559
  g.Geodesic = Geodesic
554
560
  from geographiclib.geodesicline import GeodesicLine
@@ -674,9 +680,9 @@ class _Xables(object):
674
680
  return NN
675
681
 
676
682
  def _path(self, which, *dir_):
677
- self.ENV = E = _PYGEODESY(which)
678
- return _getenv(E, NN) or \
679
- (NN(dir_[0], which.__name__) if dir_ else E)
683
+ n = typename(which, which)
684
+ self.ENV = E = _PYGEODESY_ENV(n)
685
+ return _getenv(E, NN) or (NN(dir_[0], n) if dir_ else E)
680
686
 
681
687
  def X_not(self, path):
682
688
  return 'env %s=%r not executable' % (self.ENV, path)
@@ -754,7 +760,7 @@ def _diff182(deg0, deg, K_2_0=False):
754
760
  d, t = _sum2(_r(-deg0, _360),
755
761
  _r( deg, _360))
756
762
  d, t = _sum2(_r( d, _360), t)
757
- if d in (_0_0, _180_0, _N_180_0):
763
+ if _isin(d, _0_0, _180_0, _N_180_0):
758
764
  d = _copysign(d, -t if t else (deg - deg0))
759
765
  else:
760
766
  _n = _norm180
@@ -819,7 +825,7 @@ def _norm180(deg): # mimick geomath.Math.AngNormalize
819
825
  return _wrapped.Math.AngNormalize(deg)
820
826
  except AttributeError:
821
827
  d = fremainder(deg, _360_0)
822
- if d in (_180_0, _N_180_0):
828
+ if _isin(d, _180_0, _N_180_0):
823
829
  d = _copysign(_180_0, deg) if _K_2_0 else _180_0
824
830
  return d
825
831
 
@@ -1036,7 +1042,7 @@ def _unsigned2(x):
1036
1042
  return (neg(x), True) if _signBit(x) else (x, False)
1037
1043
 
1038
1044
 
1039
- __all__ += _ALL_DOCS(_CapsBase)
1045
+ __all__ += _ALL_DOCS(Caps, _CapsBase)
1040
1046
 
1041
1047
  # **) MIT License
1042
1048
  #
pygeodesy/ktm.py CHANGED
@@ -42,7 +42,7 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
42
42
  # make sure int/int division yields float quotient
43
43
  from __future__ import division as _; del _ # PYCHOK semicolon
44
44
 
45
- from pygeodesy.basics import copysign0, isodd, neg, neg_, \
45
+ from pygeodesy.basics import copysign0, _isin, isodd, neg, neg_, \
46
46
  _reverange, _xinstanceof
47
47
  from pygeodesy.constants import INF, _K0_UTM, PI, PI_2, _0_0s, _0_0, \
48
48
  _1_0, _90_0, _copysignINF
@@ -50,7 +50,7 @@ from pygeodesy.datums import Datum, _spherical_datum, _WGS84, _EWGS84
50
50
  # from pygeodesy.ellipsoids import _EWGS84 # from .datums
51
51
  from pygeodesy.errors import _ValueError, _xkwds_pop2, _Xorder
52
52
  from pygeodesy.fmath import fdot_, hypot, hypot1
53
- from pygeodesy.interns import _COMMASPACE_, _singular_
53
+ from pygeodesy.interns import _COMMASPACE_, _DMAIN_, _singular_
54
54
  from pygeodesy.karney import _atan2d, _diff182, _fix90, _norm180, \
55
55
  _polynomial, _unsigned2
56
56
  # from pygeodesy.lazily import _ALL_LAZY # from .named
@@ -66,7 +66,7 @@ from cmath import polar
66
66
  from math import asinh, cos, cosh, degrees, fabs, sin, sinh, sqrt, tanh
67
67
 
68
68
  __all__ = _ALL_LAZY.ktm
69
- __version__ = '24.11.24'
69
+ __version__ = '25.04.14'
70
70
 
71
71
 
72
72
  class KTMError(_ValueError):
@@ -141,7 +141,7 @@ class KTransverseMercator(_NamedBase):
141
141
 
142
142
  if f is not None:
143
143
  self.ellipsoid = a_earth, f
144
- elif a_earth in (_EWGS84, _WGS84, None):
144
+ elif _isin(a_earth, None, _EWGS84, _WGS84):
145
145
  pass
146
146
  elif isinstance(a_earth, Datum):
147
147
  self.datum = a_earth
@@ -603,7 +603,7 @@ _BetCoeffs = { # Generated by Maxima on 2015-05-14 22:55:13-04:00
603
603
 
604
604
  assert set(_AlpCoeffs.keys()) == set(_BetCoeffs.keys())
605
605
 
606
- if __name__ == '__main__':
606
+ if __name__ == _DMAIN_:
607
607
 
608
608
  from pygeodesy.internals import _usage
609
609
  from sys import argv, exit as _exit
pygeodesy/latlonBase.py CHANGED
@@ -10,32 +10,28 @@ u'''(INTERNAL) Base class L{LatLonBase} for all elliposiodal, spherical and N-ve
10
10
  U{RhumbLine<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1RhumbLine.html>} classes.
11
11
  '''
12
12
 
13
- from pygeodesy.basics import isstr, map1, _xinstanceof, _passarg
13
+ from pygeodesy.basics import _isin, isstr, map1, _xinstanceof
14
14
  from pygeodesy.constants import EPS, EPS0, EPS1, EPS4, INT0, R_M, \
15
15
  _EPSqrt as _TOL, _0_0, _0_5, _1_0, \
16
16
  _360_0, _umod_360
17
17
  from pygeodesy.datums import _spherical_datum
18
18
  from pygeodesy.dms import F_D, F_DMS, latDMS, lonDMS, parse3llh
19
19
  # from pygeodesy.ecef import EcefKarney # _MODS
20
+ from pygeodesy.ecefLocals import _EcefLocal
20
21
  from pygeodesy.errors import _AttributeError, IntersectionError, \
21
22
  _incompatible, _IsnotError, _TypeError, \
22
23
  _ValueError, _xattr, _xdatum, _xError, \
23
24
  _xkwds, _xkwds_get, _xkwds_item2, _xkwds_not
24
25
  # from pygeodesy.fmath import favg # _MODS
25
- # from pygeodesy.formy import antipode, compassAngle, cosineAndoyerLambert_, \
26
- # cosineForsytheAndoyerLambert_, cosineLaw, \
27
- # equirectangular, euclidean, flatLocal_, \
28
- # flatPolar, _hartzell, haversine, isantipode, \
29
- # _isequalTo, isnormal, normal, philam2n_xyz, \
30
- # thomas_, vincentys # as _formy
31
- # from pygeodesy.internals import _passarg # from .basics
26
+ # from pygeodesy import formy as _formy # _MODS.into
27
+ from pygeodesy.internals import _passarg, typename
32
28
  from pygeodesy.interns import NN, _COMMASPACE_, _concentric_, _height_, \
33
29
  _intersection_, _LatLon_, _m_, _negative_, \
34
30
  _no_, _overlap_, _too_, _point_ # PYCHOK used!
35
31
  # from pygeodesy.iters import PointsIter, points2 # _MODS
36
32
  # from pygeodesy.karney import Caps # _MODS
37
33
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
38
- from pygeodesy.named import _name2__, _NamedBase, _NamedLocal, Fmt
34
+ from pygeodesy.named import _name2__, _NamedBase, Fmt
39
35
  from pygeodesy.namedTuples import Bounds2Tuple, LatLon2Tuple, PhiLam2Tuple, \
40
36
  Trilaterate5Tuple, Vector3Tuple
41
37
  # from pygeodesy.nvectorBase import _N_vector_ # _MODS
@@ -53,13 +49,13 @@ from contextlib import contextmanager
53
49
  from math import asin, cos, degrees, fabs, radians
54
50
 
55
51
  __all__ = _ALL_LAZY.latlonBase
56
- __version__ = '24.12.31'
52
+ __version__ = '25.04.28'
57
53
 
58
54
  _formy = _MODS.into(formy=__name__)
59
55
 
60
56
 
61
- class LatLonBase(_NamedBase, _NamedLocal):
62
- '''(INTERNAL) Base class for ellipsoidal and spherical C{LatLon}s.
57
+ class LatLonBase(_NamedBase, _EcefLocal):
58
+ '''(INTERNAL) Base class for ellipsoidal and spherical C{satLon}s.
63
59
  '''
64
60
  _clipid = INT0 # polygonal clip, see .booleans
65
61
  _datum = None # L{Datum}, to be overriden
@@ -416,7 +412,7 @@ class LatLonBase(_NamedBase, _NamedLocal):
416
412
 
417
413
  @raise TypeError: Invalid B{C{delta}}, B{C{LatLon}} or B{C{LatLon_kwds}} item.
418
414
  '''
419
- t = self._Ltp._local2ecef(delta, nine=True)
415
+ t = self._ltp._local2ecef(delta, nine=True) # _EcefLocal._ltp
420
416
  return t.toLatLon(LatLon=LatLon, **_xkwds(LatLon_kwds, name=self.name))
421
417
 
422
418
  def _distanceTo(self, func, other, radius=None, **kwds):
@@ -532,7 +528,7 @@ class LatLonBase(_NamedBase, _NamedLocal):
532
528
  L{haversineTo}, L{thomasTo} and L{vincentysTo} and U{local, flat Earth
533
529
  approximation<https://www.edwilliams.org/avform.htm#flat>}.
534
530
  '''
535
- r = radius if radius in (None, R_M, _1_0, 1) else Radius(radius)
531
+ r = radius if _isin(radius, None, R_M, _1_0, 1) else Radius(radius)
536
532
  return self._distanceTo_(_formy.flatLocal_, other, radius=r, **wrap) # PYCHOK kwargs
537
533
 
538
534
  hubenyTo = flatLocalTo # for Karl Hubeny
@@ -710,7 +706,7 @@ class LatLonBase(_NamedBase, _NamedLocal):
710
706
  else:
711
707
  hp = hq = Height(height)
712
708
 
713
- # n = self.name or unused.__name__
709
+ # n = self.name or typename(unused)
714
710
  p = q = self.classof(P.lat2, P.lon2, datum=g_or_r.datum, height=hp) # name=n
715
711
  p._iteration = P.iteration
716
712
  if P is not Q:
@@ -906,6 +902,8 @@ class LatLonBase(_NamedBase, _NamedLocal):
906
902
  _update_all(self)
907
903
  self._lon = lon
908
904
 
905
+ # _ltp = _EcefLocal._ltp(self)
906
+
909
907
  def nearestOn6(self, points, closed=False, height=None, wrap=False):
910
908
  '''Locate the point on a path or polygon closest to this point.
911
909
 
@@ -1321,10 +1319,11 @@ class LatLonBase(_NamedBase, _NamedLocal):
1321
1319
  if E:
1322
1320
  for p in (p, c):
1323
1321
  e = _xattr(p, Ecef=None)
1324
- if e not in (None, E): # PYCHOK no cover
1322
+ if not _isin(e, None, E): # PYCHOK no cover
1325
1323
  n, _ = _xkwds_item2(name_point)
1326
- n = Fmt.INDEX(n, i)
1327
- raise _ValueError(n, e, txt=_incompatible(E.__name__)) # txt__
1324
+ n = Fmt.INDEX(n, i)
1325
+ t = _incompatible(typename(E))
1326
+ raise _ValueError(n, e, txt=t) # txt__
1328
1327
  return c
1329
1328
 
1330
1329
  def toDatum(self, datum2, height=None, **name):
@@ -1344,13 +1343,13 @@ class LatLonBase(_NamedBase, _NamedLocal):
1344
1343
 
1345
1344
  @raise EcefError: A C{.datum} or an ECEF issue.
1346
1345
  '''
1347
- return self._ecef9 if height in (None, self.height) else \
1346
+ return self._ecef9 if _isin(height, None, self.height) else \
1348
1347
  self._Ecef_forward(self.lat, self.lon, height=height, M=M)
1349
1348
 
1350
1349
  @deprecated_method
1351
1350
  def to3llh(self, height=None): # PYCHOK no cover
1352
1351
  '''DEPRECATED, use property L{latlonheight} or C{latlon.to3Tuple(B{height})}.'''
1353
- return self.latlonheight if height in (None, self.height) else \
1352
+ return self.latlonheight if _isin(height, None, self.height) else \
1354
1353
  self.latlon.to3Tuple(height)
1355
1354
 
1356
1355
  def toNormal(self, deep=False, **name):
@@ -1666,7 +1665,7 @@ def _trilaterate5(p1, d1, p2, d2, p3, d3, area=True, eps=EPS1, radius=R_M, wrap=
1666
1665
  return Trilaterate5Tuple(float(r), p, float(m), p, 0)
1667
1666
 
1668
1667
  n, f = (_overlap_, max) if area else (_intersection_, min)
1669
- t = _COMMASPACE_(_no_(n), '%s %.3g' % (f.__name__, m))
1668
+ t = _COMMASPACE_(_no_(n), '%s %.3g' % (typename(f), m))
1670
1669
  raise IntersectionError(area=area, eps=eps, wrap=wrap, txt=t)
1671
1670
 
1672
1671