pygeodesy 24.10.24__py2.py3-none-any.whl → 24.12.12__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.10.24.dist-info → PyGeodesy-24.12.12.dist-info}/METADATA +6 -6
- PyGeodesy-24.12.12.dist-info/RECORD +118 -0
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.12.12.dist-info}/WHEEL +1 -1
- pygeodesy/__init__.py +5 -5
- pygeodesy/__main__.py +1 -1
- pygeodesy/albers.py +5 -5
- pygeodesy/auxilats/_CX_4.py +1 -1
- pygeodesy/auxilats/_CX_6.py +1 -1
- pygeodesy/auxilats/_CX_8.py +1 -1
- pygeodesy/auxilats/_CX_Rs.py +1 -1
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +1 -1
- pygeodesy/auxilats/auxAngle.py +5 -5
- pygeodesy/auxilats/auxDLat.py +6 -6
- pygeodesy/auxilats/auxDST.py +2 -2
- pygeodesy/auxilats/auxLat.py +5 -5
- pygeodesy/auxilats/auxily.py +2 -2
- pygeodesy/azimuthal.py +55 -65
- pygeodesy/basics.py +35 -34
- pygeodesy/booleans.py +37 -37
- pygeodesy/cartesianBase.py +26 -65
- pygeodesy/clipy.py +1 -1
- pygeodesy/constants.py +7 -7
- pygeodesy/css.py +8 -9
- pygeodesy/datums.py +1 -1
- pygeodesy/deprecated/__init__.py +2 -2
- pygeodesy/deprecated/bases.py +1 -1
- pygeodesy/deprecated/classes.py +10 -10
- pygeodesy/deprecated/consterns.py +1 -1
- pygeodesy/deprecated/datum.py +1 -1
- pygeodesy/deprecated/functions.py +23 -13
- pygeodesy/deprecated/nvector.py +1 -1
- pygeodesy/deprecated/rhumbBase.py +1 -1
- pygeodesy/deprecated/rhumbaux.py +1 -1
- pygeodesy/deprecated/rhumbsolve.py +1 -1
- pygeodesy/deprecated/rhumbx.py +1 -1
- pygeodesy/dms.py +1 -1
- pygeodesy/ecef.py +63 -69
- pygeodesy/elevations.py +1 -1
- pygeodesy/ellipsoidalBase.py +106 -121
- pygeodesy/ellipsoidalBaseDI.py +115 -119
- pygeodesy/ellipsoidalExact.py +36 -38
- pygeodesy/ellipsoidalGeodSolve.py +1 -1
- pygeodesy/ellipsoidalKarney.py +1 -1
- pygeodesy/ellipsoidalNvector.py +1 -1
- pygeodesy/ellipsoidalVincenty.py +6 -5
- pygeodesy/ellipsoids.py +7 -8
- pygeodesy/elliptic.py +6 -6
- pygeodesy/epsg.py +1 -1
- pygeodesy/errors.py +25 -25
- pygeodesy/etm.py +84 -76
- pygeodesy/fmath.py +54 -51
- pygeodesy/formy.py +74 -106
- pygeodesy/frechet.py +1 -1
- pygeodesy/fstats.py +1 -1
- pygeodesy/fsums.py +82 -72
- pygeodesy/gars.py +1 -1
- pygeodesy/geodesici.py +4 -4
- pygeodesy/geodesicw.py +16 -15
- pygeodesy/geodesicx/_C4_24.py +2 -2
- pygeodesy/geodesicx/_C4_27.py +2 -2
- pygeodesy/geodesicx/_C4_30.py +2 -2
- pygeodesy/geodesicx/__init__.py +3 -3
- pygeodesy/geodesicx/__main__.py +1 -1
- pygeodesy/geodesicx/gx.py +6 -5
- pygeodesy/geodesicx/gxarea.py +2 -2
- pygeodesy/geodesicx/gxbases.py +2 -2
- pygeodesy/geodesicx/gxline.py +16 -12
- pygeodesy/geodsolve.py +8 -17
- pygeodesy/geohash.py +1 -1
- pygeodesy/geoids.py +6 -6
- pygeodesy/hausdorff.py +1 -1
- pygeodesy/heights.py +3 -3
- pygeodesy/internals.py +64 -80
- pygeodesy/interns.py +2 -3
- pygeodesy/iters.py +1 -1
- pygeodesy/karney.py +4 -4
- pygeodesy/ktm.py +20 -21
- pygeodesy/latlonBase.py +296 -346
- pygeodesy/lazily.py +15 -15
- pygeodesy/lcc.py +5 -5
- pygeodesy/ltp.py +55 -59
- pygeodesy/ltpTuples.py +208 -192
- pygeodesy/mgrs.py +9 -10
- pygeodesy/named.py +153 -3
- pygeodesy/namedTuples.py +58 -7
- pygeodesy/nvectorBase.py +122 -105
- pygeodesy/osgr.py +10 -13
- pygeodesy/points.py +1 -1
- pygeodesy/props.py +3 -3
- pygeodesy/resections.py +26 -26
- pygeodesy/rhumb/__init__.py +2 -2
- pygeodesy/rhumb/aux_.py +2 -2
- pygeodesy/rhumb/bases.py +2 -2
- pygeodesy/rhumb/ekx.py +4 -4
- pygeodesy/rhumb/solve.py +4 -4
- pygeodesy/simplify.py +291 -403
- pygeodesy/solveBase.py +1 -1
- pygeodesy/sphericalBase.py +1 -1
- pygeodesy/sphericalNvector.py +84 -127
- pygeodesy/sphericalTrigonometry.py +66 -71
- pygeodesy/streprs.py +10 -5
- pygeodesy/trf.py +1 -1
- pygeodesy/triaxials.py +23 -16
- pygeodesy/units.py +17 -17
- pygeodesy/unitsBase.py +1 -1
- pygeodesy/ups.py +4 -4
- pygeodesy/utily.py +202 -145
- pygeodesy/utm.py +10 -10
- pygeodesy/utmups.py +1 -1
- pygeodesy/utmupsBase.py +1 -1
- pygeodesy/vector2d.py +17 -17
- pygeodesy/vector3d.py +32 -23
- pygeodesy/vector3dBase.py +22 -19
- pygeodesy/webmercator.py +5 -5
- pygeodesy/wgrs.py +5 -5
- PyGeodesy-24.10.24.dist-info/RECORD +0 -118
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.12.12.dist-info}/top_level.txt +0 -0
pygeodesy/solveBase.py
CHANGED
|
@@ -505,7 +505,7 @@ __all__ += _ALL_DOCS(_SolveBase, _SolveCapsBase, _SolveGDictBase, _SolveGDictLin
|
|
|
505
505
|
|
|
506
506
|
# **) MIT License
|
|
507
507
|
#
|
|
508
|
-
# Copyright (C) 2016-
|
|
508
|
+
# Copyright (C) 2016-2025 -- mrJean1 at Gmail -- All Rights Reserved.
|
|
509
509
|
#
|
|
510
510
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
511
511
|
# copy of this software and associated documentation files (the "Software"),
|
pygeodesy/sphericalBase.py
CHANGED
|
@@ -701,7 +701,7 @@ __all__ += _ALL_DOCS(CartesianSphericalBase, LatLonSphericalBase)
|
|
|
701
701
|
|
|
702
702
|
# **) MIT License
|
|
703
703
|
#
|
|
704
|
-
# Copyright (C) 2016-
|
|
704
|
+
# Copyright (C) 2016-2025 -- mrJean1 at Gmail -- All Rights Reserved.
|
|
705
705
|
#
|
|
706
706
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
707
707
|
# copy of this software and associated documentation files (the "Software"),
|
pygeodesy/sphericalNvector.py
CHANGED
|
@@ -38,7 +38,7 @@ from pygeodesy.constants import EPS, EPS0, PI, PI2, PI_2, R_M, \
|
|
|
38
38
|
_0_0, _0_5, _1_0
|
|
39
39
|
# from pygeodesy.datums import Datums # from .sphericalBase
|
|
40
40
|
from pygeodesy.errors import PointsError, VectorError, _xError, _xkwds
|
|
41
|
-
from pygeodesy.fmath import fmean, fsum
|
|
41
|
+
from pygeodesy.fmath import fdot_, fmean, fsum
|
|
42
42
|
# from pygeodesy.fsums import fsum # from .fmath
|
|
43
43
|
from pygeodesy.interns import _composite_, _end_, _Nv00_, _other_, \
|
|
44
44
|
_point_, _pole_
|
|
@@ -55,13 +55,13 @@ from pygeodesy.sphericalBase import _m2radians, CartesianSphericalBase, \
|
|
|
55
55
|
_intersecant2, LatLonSphericalBase, \
|
|
56
56
|
_radians2m, Datums
|
|
57
57
|
from pygeodesy.units import Bearing, Bearing_, _isDegrees, Radius, Scalar
|
|
58
|
-
from pygeodesy.utily import atan2, degrees360,
|
|
59
|
-
|
|
58
|
+
from pygeodesy.utily import atan2, degrees360, sincos2, sincos2_, sincos2d, \
|
|
59
|
+
_unrollon, _Wrap, fabs
|
|
60
60
|
|
|
61
|
-
# from math import
|
|
61
|
+
# from math import fabs # from utily
|
|
62
62
|
|
|
63
63
|
__all__ = _ALL_LAZY.sphericalNvector
|
|
64
|
-
__version__ = '24.
|
|
64
|
+
__version__ = '24.11.24'
|
|
65
65
|
|
|
66
66
|
_lines_ = 'lines'
|
|
67
67
|
|
|
@@ -273,8 +273,10 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
273
273
|
a, b = self.philam
|
|
274
274
|
|
|
275
275
|
sa, ca, sb, cb, st, ct = sincos2_(a, b, t)
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
|
|
277
|
+
sa *= st
|
|
278
|
+
return Nvector(fdot_(sb, ct, -sa, cb),
|
|
279
|
+
-fdot_(cb, ct, sa, sb),
|
|
278
280
|
ca * st, name=self.name) # XXX .unit()
|
|
279
281
|
|
|
280
282
|
def greatCircleTo(self, other, wrap=False):
|
|
@@ -391,47 +393,29 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
391
393
|
return i.toLatLon(height=h, LatLon=self.classof) # Nvector(i.x, i.y, i.z).toLatLon(...)
|
|
392
394
|
|
|
393
395
|
def intersection(self, end1, start2, end2, height=None, wrap=False):
|
|
394
|
-
'''Locate
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
@arg end1: End point of the first line (L{LatLon}) or the
|
|
398
|
-
initial bearing at this point (compass C{degrees360}).
|
|
399
|
-
@arg start2: Start point of the second line (L{LatLon}).
|
|
400
|
-
@arg end2: End point of the second line (L{LatLon}) or the
|
|
401
|
-
initial bearing at the second point (compass
|
|
402
|
-
C{degrees}).
|
|
403
|
-
@kwarg height: Optional height at the intersection point,
|
|
404
|
-
overriding the mean height (C{meter}).
|
|
405
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll all
|
|
406
|
-
start and end points (C{bool}).
|
|
396
|
+
'''Locate an intersection point of two lines each defined by two
|
|
397
|
+
points or by a point and an (initial) bearing.
|
|
407
398
|
|
|
408
399
|
@return: The intersection point (L{LatLon}).
|
|
409
400
|
|
|
410
|
-
@
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
@raise ValueError: Intersection is ambiguous or infinite or
|
|
414
|
-
the lines are parallel, coincident or null.
|
|
415
|
-
|
|
416
|
-
@see: Function L{sphericalNvector.intersection} and method
|
|
417
|
-
L{intersection2}.
|
|
401
|
+
@see: Method L{intersection2<sphericalNvector.LatLon.intersection2>}
|
|
402
|
+
for further details.
|
|
418
403
|
'''
|
|
419
404
|
return intersection(self, end1, start2, end2, height=height,
|
|
420
405
|
wrap=wrap, LatLon=self.classof)
|
|
421
406
|
|
|
422
407
|
def intersection2(self, end1, start2, end2, height=None, wrap=False):
|
|
423
|
-
'''Locate
|
|
424
|
-
by two points or by a
|
|
425
|
-
|
|
426
|
-
@arg end1: End point of the
|
|
427
|
-
|
|
428
|
-
@arg start2: Start point of the
|
|
429
|
-
@arg end2: End point of the
|
|
430
|
-
|
|
431
|
-
C{degrees360}).
|
|
408
|
+
'''Locate both intersections of two (great circle) lines each defined
|
|
409
|
+
by two points or by a point and an (initial) bearing.
|
|
410
|
+
|
|
411
|
+
@arg end1: End point of the line starting at this point (L{LatLon})
|
|
412
|
+
or the bearing at this point (compass C{degrees360}).
|
|
413
|
+
@arg start2: Start point of the other line (L{LatLon}).
|
|
414
|
+
@arg end2: End point of the other line (L{LatLon}) or the bearing
|
|
415
|
+
at B{C{start2}} (compass C{degrees360}).
|
|
432
416
|
@kwarg height: Optional height at the intersection and antipodal
|
|
433
417
|
point, overriding the mean height (C{meter}).
|
|
434
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll
|
|
418
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
|
|
435
419
|
B{C{start2}} and both B{C{end*}} points (C{bool}).
|
|
436
420
|
|
|
437
421
|
@return: 2-Tuple C{(intersection, antipode)}, each a B{C{LatLon}}.
|
|
@@ -442,8 +426,7 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
442
426
|
@raise ValueError: Intersection is ambiguous or infinite or
|
|
443
427
|
the lines are parallel, coincident or null.
|
|
444
428
|
|
|
445
|
-
@see: Function L{sphericalNvector.intersection2}
|
|
446
|
-
L{intersection}.
|
|
429
|
+
@see: Function L{sphericalNvector.intersection2}.
|
|
447
430
|
'''
|
|
448
431
|
return intersection2(self, end1, start2, end2, height=height,
|
|
449
432
|
wrap=wrap, LatLon=self.classof)
|
|
@@ -472,17 +455,14 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
472
455
|
|
|
473
456
|
# sum subtended angles of each edge (using n0, the
|
|
474
457
|
# normal vector to this point for sign of α)
|
|
475
|
-
def
|
|
476
|
-
|
|
477
|
-
n0
|
|
478
|
-
_m0 = n0.minus
|
|
479
|
-
p1 = Ps[0]
|
|
480
|
-
vs1 = _m0(p1.toNvector())
|
|
458
|
+
def _subt(Ps, n0, w):
|
|
459
|
+
p1 = Ps[0]
|
|
460
|
+
vs1 = n0.minus(p1.toNvector())
|
|
481
461
|
for p2 in Ps.iterate(closed=True):
|
|
482
462
|
if w and not Ps.looped:
|
|
483
463
|
p2 = _unrollon(p1, p2)
|
|
484
|
-
p1 =
|
|
485
|
-
vs2 =
|
|
464
|
+
p1 = p2
|
|
465
|
+
vs2 = n0.minus(p2.toNvector())
|
|
486
466
|
yield vs1.angleTo(vs2, vSign=n0) # PYCHOK false
|
|
487
467
|
vs1 = vs2
|
|
488
468
|
|
|
@@ -491,7 +471,8 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
491
471
|
# an exterior point will sum to 0°. On a sphere, enclosed
|
|
492
472
|
# point angles will sum to less than 360° (due to spherical
|
|
493
473
|
# excess), exterior point angles will be small but non-zero.
|
|
494
|
-
s = fsum(
|
|
474
|
+
s = fsum(_subt(self.PointsIter(points, loop=1, wrap=wrap),
|
|
475
|
+
self.toNvector(), wrap)) # normal vector
|
|
495
476
|
# XXX are winding number optimisations equally applicable to
|
|
496
477
|
# spherical surface?
|
|
497
478
|
return fabs(s) > PI
|
|
@@ -642,8 +623,8 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
642
623
|
return r.closest, r.distance
|
|
643
624
|
|
|
644
625
|
def nearestOn3(self, points, closed=False, radius=R_M, height=None, wrap=False):
|
|
645
|
-
'''Locate the point on a path or polygon (with great circle
|
|
646
|
-
|
|
626
|
+
'''Locate the point on a path or polygon (with great circle arcs
|
|
627
|
+
joining consecutive points) closest to this point.
|
|
647
628
|
|
|
648
629
|
The closest point is either on within the extent of any great
|
|
649
630
|
circle arc or the nearest of the arc's end points.
|
|
@@ -653,14 +634,14 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
653
634
|
@kwarg radius: Mean earth radius (C{meter}) or C{None}.
|
|
654
635
|
@kwarg height: Optional height, overriding the mean height
|
|
655
636
|
for a point within the arc (C{meter}).
|
|
656
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll
|
|
657
|
-
|
|
637
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
|
|
638
|
+
B{C{points}} (C{bool}).
|
|
658
639
|
|
|
659
640
|
@return: A L{NearestOn3Tuple}C{(closest, distance, angle)} of
|
|
660
641
|
the C{closest} point (L{LatLon}), the C{distance}
|
|
661
642
|
between this and the C{closest} point in C{meter},
|
|
662
|
-
same units as B{C{radius}} or in C{radians} if
|
|
663
|
-
C{B{radius} is None} and the C{angle} from this to
|
|
643
|
+
same units as B{C{radius}} (or in C{radians} if
|
|
644
|
+
C{B{radius} is None}) and the C{angle} from this to
|
|
664
645
|
the C{closest} point in compass C{degrees360}.
|
|
665
646
|
|
|
666
647
|
@raise TypeError: Some B{C{points}} are not C{LatLon}.
|
|
@@ -668,16 +649,16 @@ class LatLon(LatLonNvectorBase, LatLonSphericalBase):
|
|
|
668
649
|
@raise ValueError: No B{C{points}}.
|
|
669
650
|
'''
|
|
670
651
|
Ps = self.PointsIter(points, loop=1, wrap=wrap)
|
|
671
|
-
|
|
652
|
+
_d = self.distanceTo
|
|
672
653
|
_n = self.nearestOn
|
|
673
654
|
|
|
674
655
|
c = p1 = Ps[0]
|
|
675
|
-
r =
|
|
656
|
+
r = _d(c, radius=None) # radians
|
|
676
657
|
for p2 in Ps.iterate(closed=closed):
|
|
677
658
|
if wrap and not Ps.looped:
|
|
678
659
|
p2 = _unrollon(p1, p2)
|
|
679
660
|
p = _n(p1, p2, height=height)
|
|
680
|
-
d =
|
|
661
|
+
d = _d(p, radius=None) # radians
|
|
681
662
|
if d < r:
|
|
682
663
|
c, r = p, d
|
|
683
664
|
p1 = p2
|
|
@@ -775,13 +756,13 @@ class Nvector(NvectorBase):
|
|
|
775
756
|
|
|
776
757
|
def greatCircle(self, bearing):
|
|
777
758
|
'''Compute the n-vector normal to great circle obtained by
|
|
778
|
-
heading on given
|
|
759
|
+
heading on given (initial) bearing from this point as its
|
|
779
760
|
n-vector.
|
|
780
761
|
|
|
781
762
|
Direction of vector is such that initial bearing vector
|
|
782
763
|
b = c × p.
|
|
783
764
|
|
|
784
|
-
@arg bearing: Initial
|
|
765
|
+
@arg bearing: Initial bearing (compass C{degrees360}).
|
|
785
766
|
|
|
786
767
|
@return: N-vector representing great circle (C{Nvector}).
|
|
787
768
|
|
|
@@ -889,77 +870,54 @@ def intersecant2(center, circle, point, other, **radius_exact_height_wrap):
|
|
|
889
870
|
|
|
890
871
|
|
|
891
872
|
def intersection(start1, end1, start2, end2, height=None, wrap=False,
|
|
892
|
-
|
|
893
|
-
'''Locate
|
|
894
|
-
by two points or by a
|
|
873
|
+
**LatLon_and_kwds):
|
|
874
|
+
'''Locate an intersection point of two (great circle) lines each defined
|
|
875
|
+
by two points or by a point and an (initial) bearing.
|
|
895
876
|
|
|
896
|
-
@
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
@arg start2: Start point of the second line (L{LatLon}).
|
|
900
|
-
@arg end2: End point of the second line (L{LatLon}) or the initial
|
|
901
|
-
bearing at the second start point (compass C{degrees360}).
|
|
902
|
-
@kwarg height: Optional height at the intersection point,
|
|
903
|
-
overriding the mean height (C{meter}).
|
|
904
|
-
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll B{C{start2}}
|
|
905
|
-
and both B{C{end*}} points (C{bool}).
|
|
906
|
-
@kwarg LatLon: Optional class to return the intersection point
|
|
907
|
-
(L{LatLon}).
|
|
908
|
-
@kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
|
|
909
|
-
arguments, ignored if C{B{LatLon} is None}.
|
|
910
|
-
|
|
911
|
-
@return: The intersection point (B{C{LatLon}}) or if C{B{LatLon}
|
|
912
|
-
is None}, a cartesian L{Ecef9Tuple}C{(x, y, z, lat, lon,
|
|
913
|
-
height, C, M, datum)} with C{C} and C{M} if available.
|
|
914
|
-
|
|
915
|
-
@raise TypeError: If B{C{start*}} or B{C{end*}} is not L{LatLon}.
|
|
916
|
-
|
|
917
|
-
@raise ValueError: Intersection is ambiguous or infinite or
|
|
918
|
-
the lines are parallel, coincident or null.
|
|
877
|
+
@return: The intersection point (L{LatLon}) or if C{B{LatLon}=None},
|
|
878
|
+
a cartesian L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
|
|
879
|
+
datum)} with C{C} and C{M} if available.
|
|
919
880
|
|
|
920
|
-
@see: Function L{sphericalNvector.intersection2}
|
|
881
|
+
@see: Function L{intersection2<sphericalNvector.intersection2>}
|
|
882
|
+
for further details.
|
|
921
883
|
'''
|
|
922
884
|
i, _, h = _intersect3(start1, end1, start2, end2, height, wrap)
|
|
923
|
-
kwds = _xkwds(
|
|
885
|
+
kwds = _xkwds(LatLon_and_kwds, height=h, LatLon=LatLon)
|
|
924
886
|
return i.toLatLon(**kwds)
|
|
925
887
|
|
|
926
888
|
|
|
927
889
|
def intersection2(start1, end1, start2, end2, height=None, wrap=False,
|
|
928
|
-
|
|
929
|
-
'''Locate
|
|
930
|
-
by two points or by a
|
|
890
|
+
**LatLon_and_kwds):
|
|
891
|
+
'''Locate both intersections of two (great circle) lines each defined
|
|
892
|
+
by two points or by a point and an (initial) bearing.
|
|
931
893
|
|
|
932
894
|
@arg start1: Start point of the first line (L{LatLon}).
|
|
933
|
-
@arg end1: End point of the first line (L{LatLon}) or the
|
|
934
|
-
|
|
935
|
-
(compass C{degrees360}).
|
|
895
|
+
@arg end1: End point of the first line (L{LatLon}) or the bearing at
|
|
896
|
+
B{C{start1}} (compass C{degrees360}).
|
|
936
897
|
@arg start2: Start point of the second line (L{LatLon}).
|
|
937
|
-
@arg end2: End point of the second line (L{LatLon}) or the
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
or if C{B{LatLon} is None}, a cartesian L{Ecef9Tuple}C{(x,
|
|
951
|
-
y, z, lat, lon, height, C, M, datum)} with C{C} and C{M}
|
|
952
|
-
if available.
|
|
898
|
+
@arg end2: End point of the second line (L{LatLon}) or the bearing at
|
|
899
|
+
B{C{start2}} (compass C{degrees360}).
|
|
900
|
+
@kwarg height: Optional height at the intersection and antipodal point,
|
|
901
|
+
overriding the mean height (C{meter}).
|
|
902
|
+
@kwarg wrap: If C{True}, wrap or I{normalize} and unroll B{C{start2}} and
|
|
903
|
+
both B{C{end*}} points (C{bool}).
|
|
904
|
+
@kwarg LatLon_and_kwds: Optional class C{B{LatLon}=}L{LatLon} to return
|
|
905
|
+
the intersection points and optionally, additional B{C{LatLon}}
|
|
906
|
+
keyword arguments, ignored if C{B{LatLon} is None}.
|
|
907
|
+
|
|
908
|
+
@return: 2-Tuple C{(intersection, antipode)}, each a (B{C{LatLon}}) or if
|
|
909
|
+
C{B{LatLon}=None}, a cartesian L{Ecef9Tuple}C{(x, y, z, lat, lon,
|
|
910
|
+
height, C, M, datum)} with C{C} and C{M} if available.
|
|
953
911
|
|
|
954
912
|
@raise TypeError: If B{C{start*}} or B{C{end*}} is not L{LatLon}.
|
|
955
913
|
|
|
956
|
-
@raise ValueError: Intersection is ambiguous or infinite or
|
|
957
|
-
|
|
914
|
+
@raise ValueError: Intersection is ambiguous or infinite or the lines are
|
|
915
|
+
parallel, coincident or null.
|
|
958
916
|
|
|
959
917
|
@see: Function L{sphericalNvector.intersection}.
|
|
960
918
|
'''
|
|
961
919
|
i, a, h = _intersect3(start1, end1, start2, end2, height, wrap)
|
|
962
|
-
kwds = _xkwds(
|
|
920
|
+
kwds = _xkwds(LatLon_and_kwds, height=h, LatLon=LatLon)
|
|
963
921
|
return i.toLatLon(**kwds), a.toLatLon(**kwds)
|
|
964
922
|
|
|
965
923
|
|
|
@@ -1022,21 +980,20 @@ def _intersect3(start1, end1, start2, end2, height, wrap):
|
|
|
1022
980
|
return (i1, i2, h) if d > 0 else (i2, i1, h)
|
|
1023
981
|
|
|
1024
982
|
|
|
1025
|
-
def meanOf(points, height=None, wrap=False,
|
|
983
|
+
def meanOf(points, height=None, wrap=False, **LatLon_and_kwds):
|
|
1026
984
|
'''Compute the I{geographic} mean of the supplied points.
|
|
1027
985
|
|
|
1028
986
|
@arg points: Array of points to be averaged (L{LatLon}[]).
|
|
1029
|
-
@kwarg height: Optional height, overriding the mean height
|
|
1030
|
-
(C{meter}).
|
|
987
|
+
@kwarg height: Optional height, overriding the mean height (C{meter}).
|
|
1031
988
|
@kwarg wrap: If C{True}, wrap or I{normalize} B{C{points}} (C{bool}).
|
|
1032
|
-
@kwarg
|
|
1033
|
-
|
|
1034
|
-
|
|
989
|
+
@kwarg LatLon_and_kwds: Optional class C{B{LatLon}=}L{LatLon} to return
|
|
990
|
+
the mean point and optionally, additional B{C{LatLon}}
|
|
991
|
+
keyword arguments, ignored if C{B{LatLon} is None}.
|
|
1035
992
|
|
|
1036
993
|
@return: Point at geographic mean and mean height (B{C{LatLon}}).
|
|
1037
994
|
|
|
1038
|
-
@raise PointsError: Insufficient number of B{C{points}} or
|
|
1039
|
-
|
|
995
|
+
@raise PointsError: Insufficient number of B{C{points}} or some
|
|
996
|
+
B{C{points}} are not C{LatLon}.
|
|
1040
997
|
'''
|
|
1041
998
|
def _N_vs(ps, w):
|
|
1042
999
|
Ps = _Nv00.PointsIter(ps, wrap=w)
|
|
@@ -1047,9 +1004,9 @@ def meanOf(points, height=None, wrap=False, LatLon=LatLon, **LatLon_kwds):
|
|
|
1047
1004
|
# geographic mean
|
|
1048
1005
|
n = _nsumOf(_N_vs(points, wrap), height, Nvector, {})
|
|
1049
1006
|
except (TypeError, ValueError) as x:
|
|
1050
|
-
raise PointsError(points=points, wrap=wrap,
|
|
1051
|
-
return n.toLatLon(**_xkwds(
|
|
1052
|
-
|
|
1007
|
+
raise PointsError(points=points, wrap=wrap, cause=x, **LatLon_and_kwds)
|
|
1008
|
+
return n.toLatLon(**_xkwds(LatLon_and_kwds, LatLon=LatLon, height=n.h,
|
|
1009
|
+
name=meanOf.__name__))
|
|
1053
1010
|
|
|
1054
1011
|
|
|
1055
1012
|
@deprecated_function
|
|
@@ -1164,8 +1121,8 @@ def sumOf(nvectors, Vector=Nvector, h=None, **Vector_kwds):
|
|
|
1164
1121
|
def triangulate(point1, bearing1, point2, bearing2,
|
|
1165
1122
|
height=None, wrap=False,
|
|
1166
1123
|
LatLon=LatLon, **LatLon_kwds):
|
|
1167
|
-
'''Locate a point given two known points and the (initial)
|
|
1168
|
-
from those points.
|
|
1124
|
+
'''Locate a point given two known, reference points and the (initial)
|
|
1125
|
+
bearing from those points.
|
|
1169
1126
|
|
|
1170
1127
|
@arg point1: First reference point (L{LatLon}).
|
|
1171
1128
|
@arg bearing1: Bearing at the first point (compass C{degrees360}).
|
|
@@ -1244,7 +1201,7 @@ __all__ += _ALL_OTHER(Cartesian, LatLon, Nvector, # classes
|
|
|
1244
1201
|
|
|
1245
1202
|
# **) MIT License
|
|
1246
1203
|
#
|
|
1247
|
-
# Copyright (C) 2016-
|
|
1204
|
+
# Copyright (C) 2016-2025 -- mrJean1 at Gmail -- All Rights Reserved.
|
|
1248
1205
|
#
|
|
1249
1206
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
1250
1207
|
# copy of this software and associated documentation files (the "Software"),
|