pygeodesy 24.6.1__py2.py3-none-any.whl → 24.6.24__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.6.24.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +33 -32
  4. pygeodesy/albers.py +2 -2
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +40 -39
  7. pygeodesy/auxilats/auxDLat.py +3 -2
  8. pygeodesy/auxilats/auxLat.py +16 -18
  9. pygeodesy/auxilats/auxily.py +1 -1
  10. pygeodesy/azimuthal.py +10 -10
  11. pygeodesy/basics.py +9 -1
  12. pygeodesy/booleans.py +53 -66
  13. pygeodesy/cartesianBase.py +143 -155
  14. pygeodesy/css.py +14 -18
  15. pygeodesy/datums.py +6 -6
  16. pygeodesy/deprecated/__init__.py +1 -1
  17. pygeodesy/deprecated/classes.py +16 -2
  18. pygeodesy/deprecated/datum.py +3 -3
  19. pygeodesy/deprecated/functions.py +6 -8
  20. pygeodesy/dms.py +23 -27
  21. pygeodesy/ecef.py +49 -55
  22. pygeodesy/elevations.py +4 -4
  23. pygeodesy/ellipsoidalBase.py +28 -70
  24. pygeodesy/ellipsoidalBaseDI.py +19 -23
  25. pygeodesy/ellipsoidalExact.py +3 -3
  26. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  27. pygeodesy/ellipsoidalKarney.py +37 -60
  28. pygeodesy/ellipsoidalNvector.py +44 -50
  29. pygeodesy/ellipsoidalVincenty.py +11 -14
  30. pygeodesy/ellipsoids.py +107 -101
  31. pygeodesy/errors.py +101 -49
  32. pygeodesy/etm.py +32 -44
  33. pygeodesy/formy.py +55 -58
  34. pygeodesy/frechet.py +20 -23
  35. pygeodesy/fsums.py +4 -4
  36. pygeodesy/gars.py +3 -4
  37. pygeodesy/geodesici.py +909 -0
  38. pygeodesy/geodesicw.py +11 -13
  39. pygeodesy/geodesicx/__init__.py +4 -4
  40. pygeodesy/geodesicx/gx.py +18 -28
  41. pygeodesy/geodesicx/gxbases.py +20 -8
  42. pygeodesy/geodesicx/gxline.py +16 -22
  43. pygeodesy/geodsolve.py +102 -34
  44. pygeodesy/geohash.py +39 -60
  45. pygeodesy/geoids.py +28 -37
  46. pygeodesy/hausdorff.py +21 -23
  47. pygeodesy/heights.py +15 -28
  48. pygeodesy/internals.py +19 -12
  49. pygeodesy/interns.py +4 -10
  50. pygeodesy/iters.py +2 -2
  51. pygeodesy/karney.py +20 -4
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +202 -191
  54. pygeodesy/lazily.py +96 -59
  55. pygeodesy/lcc.py +29 -32
  56. pygeodesy/ltp.py +43 -24
  57. pygeodesy/ltpTuples.py +190 -183
  58. pygeodesy/mgrs.py +35 -9
  59. pygeodesy/named.py +106 -72
  60. pygeodesy/namedTuples.py +43 -14
  61. pygeodesy/nvectorBase.py +23 -27
  62. pygeodesy/osgr.py +9 -9
  63. pygeodesy/points.py +7 -7
  64. pygeodesy/rhumb/__init__.py +1 -1
  65. pygeodesy/rhumb/aux_.py +5 -5
  66. pygeodesy/rhumb/bases.py +30 -31
  67. pygeodesy/rhumb/ekx.py +3 -4
  68. pygeodesy/rhumb/solve.py +8 -61
  69. pygeodesy/solveBase.py +22 -19
  70. pygeodesy/sphericalBase.py +26 -21
  71. pygeodesy/sphericalNvector.py +13 -13
  72. pygeodesy/sphericalTrigonometry.py +86 -97
  73. pygeodesy/streprs.py +8 -36
  74. pygeodesy/trf.py +3 -3
  75. pygeodesy/triaxials.py +117 -91
  76. pygeodesy/units.py +229 -321
  77. pygeodesy/unitsBase.py +116 -108
  78. pygeodesy/ups.py +26 -31
  79. pygeodesy/utily.py +12 -11
  80. pygeodesy/utm.py +35 -40
  81. pygeodesy/utmups.py +43 -46
  82. pygeodesy/utmupsBase.py +9 -10
  83. pygeodesy/vector3d.py +59 -62
  84. pygeodesy/vector3dBase.py +17 -15
  85. pygeodesy/webmercator.py +19 -21
  86. pygeodesy/wgrs.py +18 -20
  87. PyGeodesy-24.6.1.dist-info/RECORD +0 -116
  88. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
  89. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
@@ -18,15 +18,13 @@ from pygeodesy.cartesianBase import CartesianBase # PYCHOK used!
18
18
  from pygeodesy.datums import Datum, Datums, _earth_ellipsoid, _ellipsoidal_datum, \
19
19
  Transform, _WGS84, _EWGS84, _xinstanceof # _spherical_datum
20
20
  # from pygeodesy.ellipsoids import _EWGS84 # from .datums
21
- from pygeodesy.errors import _incompatible, _IsnotError, RangeError, _TypeError, \
22
- _ValueError, _xattr, _xellipsoidal, _xError, _xkwds, \
23
- _xkwds_not
21
+ from pygeodesy.errors import _IsnotError, RangeError, _TypeError, _xattr, _xellipsoidal, \
22
+ _xellipsoids, _xError, _xkwds, _xkwds_not
24
23
  # from pygeodesy.fmath import favg # _MODS
25
24
  from pygeodesy.interns import NN, _COMMA_, _ellipsoidal_
26
25
  from pygeodesy.latlonBase import LatLonBase, _trilaterate5, fabs, _Wrap
27
- # from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS # from .named
26
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
28
27
  # from pygeodesy.lcc import toLcc # _MODS
29
- from pygeodesy.named import _name1__, _ALL_DOCS, _ALL_LAZY, _MODS
30
28
  # from pygeodesy.namedTuples import Vector3Tuple # _MODS
31
29
  from pygeodesy.props import deprecated_method, deprecated_property_RO, \
32
30
  Property_RO, property_doc_, property_RO, _update_all
@@ -37,7 +35,7 @@ from pygeodesy.units import Epoch, _isDegrees, Radius_, _1mm as _TOL_M
37
35
  # from math import fabs # from .latlonBase
38
36
 
39
37
  __all__ = _ALL_LAZY.ellipsoidalBase
40
- __version__ = '24.05.31'
38
+ __version__ = '24.06.24'
41
39
 
42
40
 
43
41
  class CartesianEllipsoidalBase(CartesianBase):
@@ -121,13 +119,13 @@ class CartesianEllipsoidalBase(CartesianBase):
121
119
  @kwarg Vector_kwds: Optional, additional B{C{Vector}} keyword arguments,
122
120
  ignored if C{B{Vector} is None}.
123
121
 
124
- @return: If B{C{sphere}} is C{True}, a 2-tuple of the C{center} and C{radius}
125
- of the intersection of the I{spheres}. The C{radius} is C{0.0} for
122
+ @return: If C{B{sphere} is True}, a 2-tuple of the C{center} and C{radius} of
123
+ the intersection of the I{spheres}. The C{radius} is C{0.0} for
126
124
  abutting spheres (and the C{center} is aka the I{radical center}).
127
125
 
128
- If B{C{sphere}} is C{False}, a 2-tuple with the two intersection
129
- points of the I{circles}. For abutting circles, both points are
130
- the same instance, aka the I{radical center}.
126
+ If C{B{sphere} is False}, a 2-tuple with the two intersection points
127
+ of the I{circles}. For abutting circles, both points are the same
128
+ instance, aka the I{radical center}.
131
129
 
132
130
  @raise IntersectionError: Concentric, invalid or non-intersecting spheres or circles.
133
131
 
@@ -225,26 +223,25 @@ class LatLonEllipsoidalBase(LatLonBase):
225
223
 
226
224
  @arg latlonh: Latitude (C{degrees} or DMS C{str} with N or S suffix) or
227
225
  a previous C{LatLon} instance provided C{B{lon}=None}.
228
- @kwarg lon: Longitude (C{degrees} or DMS C{str} with E or W suffix) or
229
- C(None), indicating B{C{latlonh}} is a C{LatLon}.
230
- @kwarg height: Optional height above (or below) the earth surface
231
- (C{meter}, same units as the datum's ellipsoid axes).
226
+ @kwarg lon: Longitude (C{degrees} or DMS C{str} with E or W suffix) or C(None),
227
+ indicating B{C{latlonh}} is a C{LatLon}.
228
+ @kwarg height: Optional height above (or below) the earth surface (C{meter},
229
+ same units as the datum's ellipsoid axes).
232
230
  @kwarg datum: Optional, ellipsoidal datum to use (L{Datum}, L{Ellipsoid},
233
231
  L{Ellipsoid2} or L{a_f2Tuple}).
234
232
  @kwarg reframe: Optional reference frame (L{RefFrame}).
235
- @kwarg epoch: Optional epoch to observe for B{C{reframe}} (C{scalar}),
236
- a non-zero, fractional calendar year; silently ignored
237
- if C{B{reframe}=None}.
238
- @kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}} and B{C{lon}}
239
- (C{bool}).
233
+ @kwarg epoch: Optional epoch to observe for B{C{reframe}} (C{scalar}), a
234
+ non-zero, fractional calendar year, but silently ignored if
235
+ C{B{reframe}=None}.
236
+ @kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}} and B{C{lon}} (C{bool}).
240
237
  @kwarg name: Optional C{B{name}=NN} (C{str}).
241
238
 
242
- @raise RangeError: Value of C{lat} or B{C{lon}} outside the valid
243
- range and L{rangerrors} set to C{True}.
239
+ @raise RangeError: Value of C{lat} or B{C{lon}} outside the valid range and
240
+ L{rangerrors} set to C{True}.
244
241
 
245
- @raise TypeError: If B{C{latlonh}} is not a C{LatLon}, B{C{datum}} is
246
- not a L{Datum}, B{C{reframe}} is not a L{RefFrame}
247
- or B{C{epoch}} is not C{scalar} non-zero.
242
+ @raise TypeError: If B{C{latlonh}} is not a C{LatLon}, B{C{datum}} is not a
243
+ L{Datum}, B{C{reframe}} is not a L{RefFrame} or B{C{epoch}}
244
+ is not C{scalar} non-zero.
248
245
 
249
246
  @raise UnitError: Invalid B{C{lat}}, B{C{lon}} or B{C{height}}.
250
247
  '''
@@ -291,13 +288,6 @@ class LatLonEllipsoidalBase(LatLonBase):
291
288
  '''DEPRECATED, use method L{toRefFrame}.'''
292
289
  return self.toRefFrame(reframe2)
293
290
 
294
- @Property_RO
295
- def _css(self):
296
- '''(INTERNAL) Get this C{LatLon} point as a Cassini-Soldner location (L{Css}).
297
- '''
298
- css = _MODS.css
299
- return css.toCss(self, height=self.height, Css=css.Css, name=self.name)
300
-
301
291
  @property_doc_(''' this points's datum (L{Datum}).''')
302
292
  def datum(self):
303
293
  '''Get this point's datum (L{Datum}).
@@ -308,8 +298,7 @@ class LatLonEllipsoidalBase(LatLonBase):
308
298
  def datum(self, datum):
309
299
  '''Set this point's datum I{without conversion} (L{Datum}).
310
300
 
311
- @raise TypeError: The B{C{datum}} is not a L{Datum}
312
- or not ellipsoidal.
301
+ @raise TypeError: The B{C{datum}} is not a L{Datum} or not ellipsoidal.
313
302
  '''
314
303
  _xinstanceof(Datum, datum=datum)
315
304
  if not datum.isEllipsoidal:
@@ -418,9 +407,7 @@ class LatLonEllipsoidalBase(LatLonBase):
418
407
  e = other.datum.ellipsoid
419
408
  except AttributeError:
420
409
  e = E # no datum, XXX assume equivalent?
421
- if e != E:
422
- raise _ValueError(e.named2, txt=_incompatible(E.named2))
423
- return E
410
+ return _xellipsoids(E, e)
424
411
 
425
412
  @property_doc_(''' this point's observed or C{reframe} epoch (C{float}).''')
426
413
  def epoch(self):
@@ -644,13 +631,6 @@ class LatLonEllipsoidalBase(LatLonBase):
644
631
  '''
645
632
  return self._iteration
646
633
 
647
- @Property_RO
648
- def _lcc(self):
649
- '''(INTERNAL) Get this C{LatLon} point as a Lambert location (L{Lcc}).
650
- '''
651
- lcc = _MODS.lcc
652
- return lcc.toLcc(self, height=self.height, Lcc=lcc.Lcc, name=self.name)
653
-
654
634
  def midpointTo(self, other, height=None, fraction=_0_5, wrap=False):
655
635
  '''Find the midpoint on a geodesic between this and an other point.
656
636
 
@@ -722,20 +702,6 @@ class LatLonEllipsoidalBase(LatLonBase):
722
702
  height=height, wrap=wrap, tol=tol)
723
703
  return t.closest
724
704
 
725
- @Property_RO
726
- def _osgr(self):
727
- '''(INTERNAL) Get this C{LatLon} point as an OSGR coordinate (L{Osgr}),
728
- based on the OS recommendation.
729
- '''
730
- return _MODS.osgr.toOsgr(self, kTM=False, name=self.name) # datum=self.datum
731
-
732
- @Property_RO
733
- def _osgrTM(self):
734
- '''(INTERNAL) Get this C{LatLon} point as an OSGR coordinate (L{Osgr})
735
- based on I{Karney}'s Krüger implementation.
736
- '''
737
- return _MODS.osgr.toOsgr(self, kTM=True, name=self.name) # datum=self.datum
738
-
739
705
  def parse(self, strllh, height=0, datum=None, epoch=None, reframe=None,
740
706
  sep=_COMMA_, wrap=False, **name):
741
707
  '''Parse a string consisting of C{"lat, lon[, height]"},
@@ -832,8 +798,7 @@ class LatLonEllipsoidalBase(LatLonBase):
832
798
 
833
799
  @see: Function L{pygeodesy.toCss}.
834
800
  '''
835
- return self._css if not toCss_kwds else _MODS.css.toCss(
836
- self, **_name1__(toCss_kwds, _or_nameof=self))
801
+ return _MODS.css.toCss(self, **self._name1__(toCss_kwds))
837
802
 
838
803
  def toDatum(self, datum2, height=None, **name):
839
804
  '''Convert this point to an other datum.
@@ -869,8 +834,7 @@ class LatLonEllipsoidalBase(LatLonBase):
869
834
 
870
835
  @see: Function L{pygeodesy.toEtm8}.
871
836
  '''
872
- return self._etm if not toEtm8_kwds else _MODS.etm.toEtm8(
873
- self, **_name1__(toEtm8_kwds, _or_nameof=self))
837
+ return _MODS.etm.toEtm8(self, **self._name1__(toEtm8_kwds)) if toEtm8_kwds else self._etm
874
838
 
875
839
  def toLcc(self, **toLcc_kwds):
876
840
  '''Convert this C{LatLon} point to a Lambert location.
@@ -881,8 +845,7 @@ class LatLonEllipsoidalBase(LatLonBase):
881
845
 
882
846
  @see: Function L{pygeodesy.toLcc}.
883
847
  '''
884
- return self._lcc if not toLcc_kwds else _MODS.lcc.toLcc(
885
- self, **_name1__(toLcc_kwds, _or_nameof=self))
848
+ return _MODS.lcc.toLcc(self, **self._name1__(toLcc_kwds))
886
849
 
887
850
  def toMgrs(self, center=False, pole=NN):
888
851
  '''Convert this C{LatLon} point to an MGRS coordinate.
@@ -911,12 +874,7 @@ class LatLonEllipsoidalBase(LatLonBase):
911
874
 
912
875
  @see: Function L{pygeodesy.toOsgr}.
913
876
  '''
914
- if toOsgr_kwds:
915
- kwds = _name1__(toOsgr_kwds, _or_nameof=self)
916
- r = _MODS.osgr.toOsgr(self, kTM=kTM, **kwds)
917
- else:
918
- r = self._osgrTM if kTM else self._osgr
919
- return r
877
+ return _MODS.osgr.toOsgr(self, kTM=kTM, **self._name1__(toOsgr_kwds))
920
878
 
921
879
  def toRefFrame(self, reframe2, reframe=None, epoch=None, epoch2=None, height=None, **name):
922
880
  '''Convert this point to an other reference frame and epoch.
@@ -7,7 +7,7 @@ class C{LatLonEllipsoidalBaseDI} and functions.
7
7
  # make sure int/int division yields float quotient, see .basics
8
8
  from __future__ import division as _; del _ # PYCHOK semicolon
9
9
 
10
- from pygeodesy.basics import isLatLon, issubclassof, map2
10
+ from pygeodesy.basics import isLatLon, _xsubclassof
11
11
  from pygeodesy.constants import EPS, MAX, PI, PI2, PI_4, isnear0, isnear1, \
12
12
  _EPSqrt as _TOL, _0_0, _0_5, _1_5, _3_0
13
13
  # from pygeodesy.dms import F_DMS # _MODS
@@ -20,8 +20,7 @@ from pygeodesy.formy import _isequalTo, opposing, _radical2
20
20
  from pygeodesy.interns import _antipodal_, _concentric_, _ellipsoidal_, \
21
21
  _exceed_PI_radians_, _low_, _near_, \
22
22
  _SPACE_, _too_
23
- from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, \
24
- _dunder_nameof
23
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
25
24
  from pygeodesy.namedTuples import Bearing2Tuple, Destination2Tuple, \
26
25
  Intersection3Tuple, NearestOn2Tuple, \
27
26
  NearestOn8Tuple, _LL4Tuple
@@ -35,7 +34,7 @@ from pygeodesy.utily import m2km, unroll180, _unrollon, _unrollon3, \
35
34
  from math import degrees, radians
36
35
 
37
36
  __all__ = _ALL_LAZY.ellipsoidalBaseDI
38
- __version__ = '24.05.19'
37
+ __version__ = '24.06.17'
39
38
 
40
39
  _polar__ = 'polar?'
41
40
  _B2END = _1_5 # _intersect3 bearing to pseudo-end point factor
@@ -111,9 +110,8 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
111
110
  def _Direct(self, distance, bearing, LL, height): # overloaded by I{Vincenty}
112
111
  '''(INTERNAL) I{Karney}'s C{Direct} method.
113
112
 
114
- @return: A L{Destination2Tuple}C{(destination, final)} or
115
- a L{Destination3Tuple}C{(lat, lon, final)} if
116
- B{C{LL}} is C{None}.
113
+ @return: A L{Destination2Tuple}C{(destination, final)} or a
114
+ L{Destination3Tuple}C{(lat, lon, final)} if C{B{LL} is None}.
117
115
  '''
118
116
  g = self.geodesic
119
117
  r = g.Direct3(self.lat, self.lon, bearing, distance)
@@ -337,17 +335,17 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
337
335
 
338
336
  @arg points: The path or polygon points (C{LatLon}[]).
339
337
  @kwarg closed: Optionally, close the polygon (C{bool}).
340
- @kwarg height: Optional height, overriding the height of this and
341
- all other points (C{meter}, conventionally). If
342
- B{C{height}} is C{None}, the height of each point
343
- is taken into account for distances.
344
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
345
- B{C{points}} (C{bool}).
346
-
347
- @return: A L{NearestOn8Tuple}C{(closest, distance, fi, j, start,
348
- end, initial, final)} with C{distance} in C{meter},
349
- conventionally and with the C{closest}, the C{start}
350
- the C{end} point each an instance of this C{LatLon}.
338
+ @kwarg height: Optional height, overriding the height of this and all
339
+ other points (C{meter}, conventionally). If C{B{height}
340
+ is None}, each point's height is taken into account to
341
+ compute distances.
342
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}}
343
+ (C{bool}).
344
+
345
+ @return: A L{NearestOn8Tuple}C{(closest, distance, fi, j, start, end,
346
+ initial, final)} with C{distance} in C{meter}, conventionally
347
+ and with the C{closest}, the C{start} the C{end} point each
348
+ an instance of this C{LatLon}.
351
349
 
352
350
  @raise PointsError: Insufficient number of B{C{points}}.
353
351
 
@@ -422,7 +420,7 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
422
420
  conventionally) or C{None} for an interpolated height.
423
421
  @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{point}}
424
422
  and/or B{C{other}} (C{bool}).
425
- @kwarg tol: Convergence tolerance (C{scalar}).
423
+ @kwarg tol: Convergence tolerance (C{meter}).
426
424
 
427
425
  @return: The intersection point, an instance of this C{LatLon}.
428
426
 
@@ -572,10 +570,8 @@ def _Equidistant00(equidistant, p1):
572
570
  if equidistant is None or not callable(equidistant):
573
571
  equidistant = p1.Equidistant
574
572
  else:
575
- Eqs = _MODS.azimuthal._Equidistants
576
- if not issubclassof(equidistant, *Eqs): # PYCHOK no cover
577
- t = map2(_dunder_nameof, Eqs)
578
- raise _IsnotError(*t, equidistant=equidistant)
573
+ _xsubclassof(*_MODS.azimuthal._Equidistants,
574
+ equidistant=equidistant)
579
575
  return equidistant(0, 0, p1.datum)
580
576
 
581
577
 
@@ -24,7 +24,7 @@ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
24
24
  # from math import fabs # from .karney
25
25
 
26
26
  __all__ = _ALL_LAZY.ellipsoidalExact
27
- __version__ = '22.02.18'
27
+ __version__ = '24.06.11'
28
28
 
29
29
 
30
30
  class Cartesian(CartesianEllipsoidalBase):
@@ -39,7 +39,7 @@ class Cartesian(CartesianEllipsoidalBase):
39
39
  B{datum}=...} to override this L{LatLon} class
40
40
  or specify C{B{LatLon}=None}.
41
41
 
42
- @return: The geodetic point (L{LatLon}) or if B{C{LatLon}} is C{None},
42
+ @return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
43
43
  an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
44
44
  with C{C} and C{M} if available.
45
45
 
@@ -78,7 +78,7 @@ class LatLon(LatLonEllipsoidalBaseDI):
78
78
  L{Cartesian} class or set C{B{Cartesian}=None}.
79
79
 
80
80
  @return: The cartesian (ECEF) coordinates as (L{Cartesian}) or if
81
- B{C{Cartesian}} is C{None}, an L{Ecef9Tuple}C{(x, y, z, lat,
81
+ C{B{Cartesian} is None}, an L{Ecef9Tuple}C{(x, y, z, lat,
82
82
  lon, height, C, M, datum)} with C{C} and C{M} if available.
83
83
 
84
84
  @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
@@ -24,7 +24,7 @@ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
24
24
  # from math import fabs # from .karney
25
25
 
26
26
  __all__ = _ALL_LAZY.ellipsoidalGeodSolve
27
- __version__ = '24.05.25'
27
+ __version__ = '24.06.11'
28
28
 
29
29
 
30
30
  class Cartesian(CartesianEllipsoidalBase):
@@ -39,7 +39,7 @@ class Cartesian(CartesianEllipsoidalBase):
39
39
  B{datum}=...} to override this L{LatLon}
40
40
  class or specify C{B{LatLon}=None}.
41
41
 
42
- @return: The geodetic point (L{LatLon}) or if B{C{LatLon}} is C{None},
42
+ @return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None},
43
43
  an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
44
44
  with C{C} and C{M} if available.
45
45
 
@@ -73,18 +73,15 @@ class LatLon(LatLonEllipsoidalBaseDI):
73
73
  def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
74
74
  '''Convert this point to exact cartesian (ECEF) coordinates.
75
75
 
76
- @kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}}
77
- and other keyword arguments, ignored if C{B{Cartesian} is None}.
78
- Use C{B{Cartesian}=...} to override this L{Cartesian} class
79
- or set C{B{Cartesian}=None}.
76
+ @kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}} and other keyword
77
+ arguments, ignored if C{B{Cartesian} is None}. Use C{B{Cartesian}=Class}
78
+ to override this L{Cartesian} class or set C{B{Cartesian}=None}.
80
79
 
81
- @return: The cartesian (ECEF) coordinates (L{Cartesian}) or if
82
- B{C{Cartesian}} is C{None}, an L{Ecef9Tuple}C{(x, y, z,
83
- lat, lon, height, C, M, datum)} with C{C} and C{M} if
84
- available.
80
+ @return: The cartesian (ECEF) coordinates (L{Cartesian}) or if C{B{Cartesian} is
81
+ None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
82
+ C{C} and C{M} if available.
85
83
 
86
- @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
87
- B{C{Cartesian_datum_kwds}}.
84
+ @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other B{C{Cartesian_datum_kwds}}.
88
85
  '''
89
86
  kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
90
87
  return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
@@ -93,25 +90,20 @@ class LatLon(LatLonEllipsoidalBaseDI):
93
90
  def areaOf(points, datum=_WGS84, wrap=True):
94
91
  '''Compute the area of an (ellipsoidal) polygon or composite.
95
92
 
96
- @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
97
- L{BooleanGH}).
93
+ @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
98
94
  @kwarg datum: Optional datum (L{Datum}).
99
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
100
- B{C{points}} (C{bool}).
95
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
101
96
 
102
- @return: Area (C{meter}, same as units of the B{C{datum}}'s
103
- ellipsoid axes, I{squared}).
97
+ @return: Area (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes, I{squared}).
104
98
 
105
99
  @raise PointsError: Insufficient number of B{C{points}}.
106
100
 
107
101
  @raise TypeError: Some B{C{points}} are not L{LatLon}.
108
102
 
109
- @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
110
- longitudes not supported.
103
+ @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled longitudes not supported.
111
104
 
112
- @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf},
113
- L{ellipsoidalKarney.areaOf}, L{sphericalNvector.areaOf}
114
- and L{sphericalTrigonometry.areaOf}.
105
+ @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf}, L{ellipsoidalKarney.areaOf},
106
+ L{sphericalNvector.areaOf} and L{sphericalTrigonometry.areaOf}.
115
107
  '''
116
108
  return fabs(_polygon(datum.ellipsoid.geodsolve, points, True, False, wrap))
117
109
 
@@ -3,13 +3,12 @@
3
3
 
4
4
  u'''Ellipsoidal, I{Karney}-based geodesy.
5
5
 
6
- Ellipsoidal geodetic (lat-/longitude) L{LatLon} and geocentric
7
- (ECEF) L{Cartesian} classes and functions L{areaOf}, L{intersections2},
8
- L{isclockwise}, L{nearestOn} and L{perimeterOf}, all requiring I{Charles
9
- Karney}'s U{geographiclib <https://PyPI.org/project/geographiclib>}
10
- Python package to be installed.
6
+ Ellipsoidal geodetic (lat-/longitude) L{LatLon} and geocentric (ECEF) L{Cartesian}
7
+ classes and functions L{areaOf}, L{intersection3}, L{intersections2}, L{isclockwise},
8
+ L{nearestOn} and L{perimeterOf}, requiring I{Charles F.F. Karney}'s U{geographiclib
9
+ <https://PyPI.org/project/geographiclib>} Python package to be installed.
11
10
 
12
- Here's an example usage of C{ellipsoidalKarney}:
11
+ A usage example of C{ellipsoidalKarney}:
13
12
 
14
13
  >>> from pygeodesy.ellipsoidalKarney import LatLon
15
14
  >>> Newport_RI = LatLon(41.49008, -71.312796)
@@ -43,25 +42,23 @@ from pygeodesy.props import deprecated_method, Property_RO
43
42
  # from math import fabs # from .karney
44
43
 
45
44
  __all__ = _ALL_LAZY.ellipsoidalKarney
46
- __version__ = '24.05.25'
45
+ __version__ = '24.06.11'
47
46
 
48
47
 
49
48
  class Cartesian(CartesianEllipsoidalBase):
50
- '''Extended to convert C{Karney}-based L{Cartesian} to
51
- C{Karney}-based L{LatLon} points.
49
+ '''Extended to convert C{Karney}-based L{Cartesian} to C{Karney}-based L{LatLon} points.
52
50
  '''
53
51
 
54
52
  def toLatLon(self, **LatLon_and_kwds): # PYCHOK LatLon=LatLon, datum=None
55
53
  '''Convert this cartesian point to a C{Karney}-based geodetic point.
56
54
 
57
- @kwarg LatLon_and_kwds: Optional L{LatLon} and L{LatLon} keyword
58
- arguments as C{datum}. Use C{B{LatLon}=...,
59
- B{datum}=...} to override this L{LatLon}
60
- class or specify C{B{LatLon}=None}.
55
+ @kwarg LatLon_and_kwds: Optional L{LatLon} and L{LatLon} keyword arguments
56
+ as C{datum}. Use C{B{LatLon}=..., B{datum}=...} to override
57
+ this L{LatLon} class or specify C{B{LatLon}=None}.
61
58
 
62
- @return: The geodetic point (L{LatLon}) or if B{C{LatLon}} is C{None},
63
- an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
64
- with C{C} and C{M} if available.
59
+ @return: The geodetic point (L{LatLon}) or if C{B{LatLon} is None}, an
60
+ L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with C{C}
61
+ and C{M} if available.
65
62
 
66
63
  @raise TypeError: Invalid B{C{LatLon_and_kwds}} argument.
67
64
  '''
@@ -70,13 +67,9 @@ class Cartesian(CartesianEllipsoidalBase):
70
67
 
71
68
 
72
69
  class LatLon(LatLonEllipsoidalBaseDI):
73
- '''An ellipsoidal L{LatLon} similar to L{ellipsoidalVincenty.LatLon}
74
- but using I{Charles F. F. Karney}'s Python U{geographiclib
75
- <https://PyPI.org/project/geographiclib>} to compute geodesic
76
- distances, bearings (azimuths), etc.
77
-
78
- @note: This L{LatLon} class requires the U{geographiclib
79
- <https://PyPI.org/project/geographiclib>} package.
70
+ '''An ellipsoidal L{LatLon} similar to L{ellipsoidalVincenty.LatLon} but using
71
+ I{Karney}'s Python U{geographiclib<https://PyPI.org/project/geographiclib>}
72
+ to compute geodesic distances, bearings (azimuths), etc.
80
73
  '''
81
74
 
82
75
  @deprecated_method
@@ -103,52 +96,41 @@ class LatLon(LatLonEllipsoidalBaseDI):
103
96
  def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
104
97
  '''Convert this point to C{Karney}-based cartesian (ECEF) coordinates.
105
98
 
106
- @kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}}
107
- and other keyword arguments, ignored if C{B{Cartesian} is None}.
108
- Use C{B{Cartesian}=...} to override this L{Cartesian} class or
109
- set C{B{Cartesian}=None}.
99
+ @kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}} and other keyword
100
+ arguments, ignored if C{B{Cartesian} is None}. Use C{B{Cartesian}=...} to
101
+ override this L{Cartesian} class or set C{B{Cartesian}=None}.
110
102
 
111
- @return: The cartesian (ECEF) coordinates (L{Cartesian}) or if
112
- B{C{Cartesian}} is C{None}, an L{Ecef9Tuple}C{(x, y, z,
113
- lat, lon, height, C, M, datum)} with C{C} and C{M} if
114
- available.
103
+ @return: The cartesian (ECEF) coordinates (L{Cartesian}) or if C{B{Cartesian} is
104
+ None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
105
+ C{C} and C{M} if available.
115
106
 
116
- @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
117
- B{C{Cartesian_datum_kwds}}.
107
+ @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other B{C{Cartesian_datum_kwds}}.
118
108
  '''
119
109
  kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
120
110
  return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
121
111
 
122
112
 
123
113
  def areaOf(points, datum=_WGS84, wrap=True):
124
- '''Compute the area of an (ellipsoidal) polygon or composite.
114
+ '''Compute the area of an (ellipsoidal) polygon or composite using I{Karney}'s
115
+ U{geographiclib<https://PyPI.org/project/geographiclib>} package.
125
116
 
126
- @arg points: The polygon points (L{LatLon}[], L{BooleanFHP}
127
- or L{BooleanGH}).
117
+ @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
128
118
  @kwarg datum: Optional datum (L{Datum}).
129
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
130
- B{C{points}} (C{bool}).
119
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
131
120
 
132
- @return: Area (C{meter}, same as units of the B{C{datum}}'s
133
- ellipsoid axes, I{squared}).
121
+ @return: Area (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes, I{squared}).
134
122
 
135
- @raise ImportError: Package U{geographiclib
136
- <https://PyPI.org/project/geographiclib>}
123
+ @raise ImportError: Package U{geographiclib<https://PyPI.org/project/geographiclib>}
137
124
  not installed or not found.
138
125
 
139
126
  @raise PointsError: Insufficient number of B{C{points}}.
140
127
 
141
128
  @raise TypeError: Some B{C{points}} are not L{LatLon}.
142
129
 
143
- @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
144
- longitudes not supported.
145
-
146
- @note: This function requires the U{geographiclib
147
- <https://PyPI.org/project/geographiclib>} package.
130
+ @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled longitudes not supported.
148
131
 
149
- @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf},
150
- L{ellipsoidalGeodSolve.areaOf}, L{sphericalNvector.areaOf}
151
- and L{sphericalTrigonometry.areaOf}.
132
+ @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf}, L{ellipsoidalGeodSolve.areaOf},
133
+ L{sphericalNvector.areaOf} and L{sphericalTrigonometry.areaOf}.
152
134
 
153
135
  @note: The U{area of a polygon enclosing a pole<https://GeographicLib.SourceForge.io/
154
136
  C++/doc/classGeographicLib_1_1GeodesicExact.html#a3d7a9155e838a09a48dc14d0c3fac525>}
@@ -259,7 +241,8 @@ def intersections2(center1, radius1, center2, radius2, height=None, wrap=False,
259
241
 
260
242
 
261
243
  def isclockwise(points, datum=_WGS84, wrap=True):
262
- '''Determine the direction of a path or polygon.
244
+ '''Determine the direction of a path or polygon using I{Karney}'s
245
+ U{geographiclib<https://PyPI.org/project/geographiclib>} package.
263
246
 
264
247
  @arg points: The path or polygon points (C{LatLon}[]).
265
248
  @kwarg datum: Optional datum (L{Datum}).
@@ -276,11 +259,7 @@ def isclockwise(points, datum=_WGS84, wrap=True):
276
259
 
277
260
  @raise TypeError: Some B{C{points}} are not C{LatLon}.
278
261
 
279
- @raise ValueError: The B{C{points}} enclose a pole or zero
280
- area.
281
-
282
- @note: This function requires the U{geographiclib
283
- <https://PyPI.org/project/geographiclib>} package.
262
+ @raise ValueError: The B{C{points}} enclose a pole or zero area.
284
263
 
285
264
  @see: L{pygeodesy.isclockwise}.
286
265
  '''
@@ -340,7 +319,8 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
340
319
 
341
320
 
342
321
  def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
343
- '''Compute the perimeter of an (ellipsoidal) polygon or composite.
322
+ '''Compute the perimeter of an (ellipsoidal) polygon or composite using I{Karney}'s
323
+ U{geographiclib<https://PyPI.org/project/geographiclib>} package.
344
324
 
345
325
  @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
346
326
  L{BooleanGH}).
@@ -365,9 +345,6 @@ def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
365
345
  longitudes not supported or C{B{closed}=False}
366
346
  with C{B{points}} a composite.
367
347
 
368
- @note: This function requires the U{geographiclib
369
- <https://PyPI.org/project/geographiclib>} package.
370
-
371
348
  @see: Functions L{pygeodesy.perimeterOf}, L{ellipsoidalExact.perimeterOf},
372
349
  L{ellipsoidalGeodSolve.perimeterOf}, L{sphericalNvector.perimeterOf}
373
350
  and L{sphericalTrigonometry.perimeterOf}.