pygeodesy 25.4.8__py2.py3-none-any.whl → 25.4.25__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/__init__.py +30 -27
- pygeodesy/__main__.py +3 -3
- pygeodesy/albers.py +29 -36
- pygeodesy/auxilats/_CX_4.py +2 -2
- pygeodesy/auxilats/_CX_6.py +2 -2
- pygeodesy/auxilats/_CX_8.py +2 -2
- pygeodesy/auxilats/_CX_Rs.py +9 -9
- pygeodesy/auxilats/__init__.py +3 -3
- pygeodesy/auxilats/__main__.py +8 -6
- pygeodesy/auxilats/auxAngle.py +2 -2
- pygeodesy/auxilats/auxLat.py +5 -5
- pygeodesy/auxilats/auxily.py +5 -3
- pygeodesy/azimuthal.py +7 -6
- pygeodesy/basics.py +31 -17
- pygeodesy/booleans.py +12 -10
- pygeodesy/cartesianBase.py +21 -20
- pygeodesy/clipy.py +11 -10
- pygeodesy/constants.py +11 -10
- pygeodesy/css.py +14 -11
- pygeodesy/datums.py +8 -8
- pygeodesy/deprecated/bases.py +2 -2
- pygeodesy/deprecated/classes.py +2 -2
- pygeodesy/deprecated/consterns.py +4 -4
- pygeodesy/dms.py +8 -8
- pygeodesy/ecef.py +10 -7
- pygeodesy/elevations.py +9 -8
- pygeodesy/ellipsoidalBase.py +19 -8
- pygeodesy/ellipsoidalBaseDI.py +17 -15
- pygeodesy/ellipsoidalNvector.py +6 -3
- pygeodesy/ellipsoidalVincenty.py +4 -1
- pygeodesy/ellipsoids.py +167 -138
- pygeodesy/elliptic.py +9 -9
- pygeodesy/errors.py +44 -43
- pygeodesy/etm.py +7 -7
- pygeodesy/fmath.py +10 -9
- pygeodesy/formy.py +11 -12
- pygeodesy/frechet.py +216 -109
- pygeodesy/fstats.py +5 -4
- pygeodesy/fsums.py +78 -77
- pygeodesy/gars.py +4 -3
- pygeodesy/geodesici.py +15 -14
- pygeodesy/geodesicw.py +34 -32
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +11 -9
- pygeodesy/geodesicx/gx.py +30 -33
- pygeodesy/geodesicx/gxarea.py +2 -2
- pygeodesy/geodesicx/gxline.py +5 -5
- pygeodesy/geodsolve.py +18 -17
- pygeodesy/geohash.py +5 -5
- pygeodesy/geoids.py +34 -31
- pygeodesy/hausdorff.py +17 -13
- pygeodesy/heights.py +2 -4
- pygeodesy/internals.py +28 -44
- pygeodesy/interns.py +10 -7
- pygeodesy/iters.py +8 -8
- pygeodesy/karney.py +68 -62
- pygeodesy/ktm.py +5 -5
- pygeodesy/latlonBase.py +14 -18
- pygeodesy/lazily.py +65 -63
- pygeodesy/lcc.py +11 -9
- pygeodesy/ltp.py +8 -7
- pygeodesy/ltpTuples.py +2 -2
- pygeodesy/mgrs.py +7 -6
- pygeodesy/named.py +47 -31
- pygeodesy/nvectorBase.py +7 -7
- pygeodesy/osgr.py +9 -8
- pygeodesy/points.py +12 -10
- pygeodesy/props.py +25 -25
- pygeodesy/resections.py +11 -10
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +7 -7
- pygeodesy/rhumb/bases.py +22 -20
- pygeodesy/rhumb/ekx.py +6 -6
- pygeodesy/rhumb/solve.py +15 -15
- pygeodesy/solveBase.py +3 -3
- pygeodesy/sphericalBase.py +6 -6
- pygeodesy/sphericalNvector.py +6 -5
- pygeodesy/sphericalTrigonometry.py +8 -7
- pygeodesy/streprs.py +14 -14
- pygeodesy/trf.py +14 -12
- pygeodesy/triaxials.py +29 -26
- pygeodesy/units.py +5 -4
- pygeodesy/unitsBase.py +5 -4
- pygeodesy/ups.py +3 -3
- pygeodesy/utily.py +4 -4
- pygeodesy/utmups.py +4 -4
- pygeodesy/utmupsBase.py +88 -18
- pygeodesy/vector2d.py +18 -11
- pygeodesy/vector3d.py +7 -6
- pygeodesy/webmercator.py +6 -5
- pygeodesy/wgrs.py +6 -5
- {pygeodesy-25.4.8.dist-info → pygeodesy-25.4.25.dist-info}/METADATA +27 -23
- pygeodesy-25.4.25.dist-info/RECORD +118 -0
- pygeodesy-25.4.8.dist-info/RECORD +0 -118
- {pygeodesy-25.4.8.dist-info → pygeodesy-25.4.25.dist-info}/WHEEL +0 -0
- {pygeodesy-25.4.8.dist-info → pygeodesy-25.4.25.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,
|
|
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.
|
|
169
|
+
__version__ = '25.04.14'
|
|
169
170
|
|
|
170
171
|
_2_4_ = '2.4'
|
|
171
|
-
_K_2_0 = _getenv(
|
|
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
|
-
'''
|
|
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
|
|
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 =
|
|
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
|
-
|
|
253
|
-
|
|
282
|
+
AZIMUTH_DISTANCE = AZIMUTH | DISTANCE
|
|
283
|
+
AZIMUTH_DISTANCE_AREA = AZIMUTH | DISTANCE | AREA
|
|
254
284
|
|
|
255
|
-
|
|
256
|
-
|
|
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
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
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}
|
|
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
|
-
|
|
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
|
-
'''
|
|
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.
|
|
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
|
-
|
|
678
|
-
|
|
679
|
-
|
|
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
|
|
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
|
|
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__ = '
|
|
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
|
|
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__ ==
|
|
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,7 +10,7 @@ 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
|
|
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
|
|
@@ -22,13 +22,8 @@ from pygeodesy.errors import _AttributeError, IntersectionError, \
|
|
|
22
22
|
_ValueError, _xattr, _xdatum, _xError, \
|
|
23
23
|
_xkwds, _xkwds_get, _xkwds_item2, _xkwds_not
|
|
24
24
|
# from pygeodesy.fmath import favg # _MODS
|
|
25
|
-
# from pygeodesy
|
|
26
|
-
|
|
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
|
|
25
|
+
# from pygeodesy import formy as _formy # .MODS.into
|
|
26
|
+
from pygeodesy.internals import _passarg, typename
|
|
32
27
|
from pygeodesy.interns import NN, _COMMASPACE_, _concentric_, _height_, \
|
|
33
28
|
_intersection_, _LatLon_, _m_, _negative_, \
|
|
34
29
|
_no_, _overlap_, _too_, _point_ # PYCHOK used!
|
|
@@ -53,13 +48,13 @@ from contextlib import contextmanager
|
|
|
53
48
|
from math import asin, cos, degrees, fabs, radians
|
|
54
49
|
|
|
55
50
|
__all__ = _ALL_LAZY.latlonBase
|
|
56
|
-
__version__ = '
|
|
51
|
+
__version__ = '25.04.21'
|
|
57
52
|
|
|
58
53
|
_formy = _MODS.into(formy=__name__)
|
|
59
54
|
|
|
60
55
|
|
|
61
56
|
class LatLonBase(_NamedBase, _NamedLocal):
|
|
62
|
-
'''(INTERNAL) Base class for ellipsoidal and spherical C{
|
|
57
|
+
'''(INTERNAL) Base class for ellipsoidal and spherical C{satLon}s.
|
|
63
58
|
'''
|
|
64
59
|
_clipid = INT0 # polygonal clip, see .booleans
|
|
65
60
|
_datum = None # L{Datum}, to be overriden
|
|
@@ -532,7 +527,7 @@ class LatLonBase(_NamedBase, _NamedLocal):
|
|
|
532
527
|
L{haversineTo}, L{thomasTo} and L{vincentysTo} and U{local, flat Earth
|
|
533
528
|
approximation<https://www.edwilliams.org/avform.htm#flat>}.
|
|
534
529
|
'''
|
|
535
|
-
r = radius if radius
|
|
530
|
+
r = radius if _isin(radius, None, R_M, _1_0, 1) else Radius(radius)
|
|
536
531
|
return self._distanceTo_(_formy.flatLocal_, other, radius=r, **wrap) # PYCHOK kwargs
|
|
537
532
|
|
|
538
533
|
hubenyTo = flatLocalTo # for Karl Hubeny
|
|
@@ -710,7 +705,7 @@ class LatLonBase(_NamedBase, _NamedLocal):
|
|
|
710
705
|
else:
|
|
711
706
|
hp = hq = Height(height)
|
|
712
707
|
|
|
713
|
-
# n = self.name or unused
|
|
708
|
+
# n = self.name or typename(unused)
|
|
714
709
|
p = q = self.classof(P.lat2, P.lon2, datum=g_or_r.datum, height=hp) # name=n
|
|
715
710
|
p._iteration = P.iteration
|
|
716
711
|
if P is not Q:
|
|
@@ -1321,10 +1316,11 @@ class LatLonBase(_NamedBase, _NamedLocal):
|
|
|
1321
1316
|
if E:
|
|
1322
1317
|
for p in (p, c):
|
|
1323
1318
|
e = _xattr(p, Ecef=None)
|
|
1324
|
-
if
|
|
1319
|
+
if not _isin(e, None, E): # PYCHOK no cover
|
|
1325
1320
|
n, _ = _xkwds_item2(name_point)
|
|
1326
|
-
n =
|
|
1327
|
-
|
|
1321
|
+
n = Fmt.INDEX(n, i)
|
|
1322
|
+
t = _incompatible(typename(E))
|
|
1323
|
+
raise _ValueError(n, e, txt=t) # txt__
|
|
1328
1324
|
return c
|
|
1329
1325
|
|
|
1330
1326
|
def toDatum(self, datum2, height=None, **name):
|
|
@@ -1344,13 +1340,13 @@ class LatLonBase(_NamedBase, _NamedLocal):
|
|
|
1344
1340
|
|
|
1345
1341
|
@raise EcefError: A C{.datum} or an ECEF issue.
|
|
1346
1342
|
'''
|
|
1347
|
-
return self._ecef9 if height
|
|
1343
|
+
return self._ecef9 if _isin(height, None, self.height) else \
|
|
1348
1344
|
self._Ecef_forward(self.lat, self.lon, height=height, M=M)
|
|
1349
1345
|
|
|
1350
1346
|
@deprecated_method
|
|
1351
1347
|
def to3llh(self, height=None): # PYCHOK no cover
|
|
1352
1348
|
'''DEPRECATED, use property L{latlonheight} or C{latlon.to3Tuple(B{height})}.'''
|
|
1353
|
-
return self.latlonheight if height
|
|
1349
|
+
return self.latlonheight if _isin(height, None, self.height) else \
|
|
1354
1350
|
self.latlon.to3Tuple(height)
|
|
1355
1351
|
|
|
1356
1352
|
def toNormal(self, deep=False, **name):
|
|
@@ -1666,7 +1662,7 @@ def _trilaterate5(p1, d1, p2, d2, p3, d3, area=True, eps=EPS1, radius=R_M, wrap=
|
|
|
1666
1662
|
return Trilaterate5Tuple(float(r), p, float(m), p, 0)
|
|
1667
1663
|
|
|
1668
1664
|
n, f = (_overlap_, max) if area else (_intersection_, min)
|
|
1669
|
-
t = _COMMASPACE_(_no_(n), '%s %.3g' % (f
|
|
1665
|
+
t = _COMMASPACE_(_no_(n), '%s %.3g' % (typename(f), m))
|
|
1670
1666
|
raise IntersectionError(area=area, eps=eps, wrap=wrap, txt=t)
|
|
1671
1667
|
|
|
1672
1668
|
|