pygeodesy 24.3.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 (115) hide show
  1. PyGeodesy-24.3.24.dist-info/METADATA +272 -0
  2. PyGeodesy-24.3.24.dist-info/RECORD +115 -0
  3. PyGeodesy-24.3.24.dist-info/WHEEL +6 -0
  4. PyGeodesy-24.3.24.dist-info/top_level.txt +1 -0
  5. pygeodesy/LICENSE +21 -0
  6. pygeodesy/__init__.py +615 -0
  7. pygeodesy/__main__.py +103 -0
  8. pygeodesy/albers.py +867 -0
  9. pygeodesy/auxilats/_CX_4.py +218 -0
  10. pygeodesy/auxilats/_CX_6.py +314 -0
  11. pygeodesy/auxilats/_CX_8.py +475 -0
  12. pygeodesy/auxilats/__init__.py +54 -0
  13. pygeodesy/auxilats/__main__.py +86 -0
  14. pygeodesy/auxilats/auxAngle.py +548 -0
  15. pygeodesy/auxilats/auxDLat.py +302 -0
  16. pygeodesy/auxilats/auxDST.py +296 -0
  17. pygeodesy/auxilats/auxLat.py +848 -0
  18. pygeodesy/auxilats/auxily.py +272 -0
  19. pygeodesy/azimuthal.py +1150 -0
  20. pygeodesy/basics.py +892 -0
  21. pygeodesy/booleans.py +2031 -0
  22. pygeodesy/cartesianBase.py +1062 -0
  23. pygeodesy/clipy.py +704 -0
  24. pygeodesy/constants.py +516 -0
  25. pygeodesy/css.py +660 -0
  26. pygeodesy/datums.py +752 -0
  27. pygeodesy/deprecated/__init__.py +61 -0
  28. pygeodesy/deprecated/bases.py +40 -0
  29. pygeodesy/deprecated/classes.py +262 -0
  30. pygeodesy/deprecated/consterns.py +54 -0
  31. pygeodesy/deprecated/datum.py +40 -0
  32. pygeodesy/deprecated/functions.py +375 -0
  33. pygeodesy/deprecated/nvector.py +48 -0
  34. pygeodesy/deprecated/rhumbBase.py +32 -0
  35. pygeodesy/deprecated/rhumbaux.py +33 -0
  36. pygeodesy/deprecated/rhumbsolve.py +33 -0
  37. pygeodesy/deprecated/rhumbx.py +33 -0
  38. pygeodesy/dms.py +986 -0
  39. pygeodesy/ecef.py +1348 -0
  40. pygeodesy/elevations.py +279 -0
  41. pygeodesy/ellipsoidalBase.py +1224 -0
  42. pygeodesy/ellipsoidalBaseDI.py +913 -0
  43. pygeodesy/ellipsoidalExact.py +343 -0
  44. pygeodesy/ellipsoidalGeodSolve.py +343 -0
  45. pygeodesy/ellipsoidalKarney.py +403 -0
  46. pygeodesy/ellipsoidalNvector.py +685 -0
  47. pygeodesy/ellipsoidalVincenty.py +590 -0
  48. pygeodesy/ellipsoids.py +2476 -0
  49. pygeodesy/elliptic.py +1198 -0
  50. pygeodesy/epsg.py +243 -0
  51. pygeodesy/errors.py +804 -0
  52. pygeodesy/etm.py +1190 -0
  53. pygeodesy/fmath.py +1013 -0
  54. pygeodesy/formy.py +1818 -0
  55. pygeodesy/frechet.py +865 -0
  56. pygeodesy/fstats.py +760 -0
  57. pygeodesy/fsums.py +1898 -0
  58. pygeodesy/gars.py +358 -0
  59. pygeodesy/geodesicw.py +581 -0
  60. pygeodesy/geodesicx/_C4_24.py +1699 -0
  61. pygeodesy/geodesicx/_C4_27.py +2395 -0
  62. pygeodesy/geodesicx/_C4_30.py +3301 -0
  63. pygeodesy/geodesicx/__init__.py +48 -0
  64. pygeodesy/geodesicx/__main__.py +91 -0
  65. pygeodesy/geodesicx/gx.py +1382 -0
  66. pygeodesy/geodesicx/gxarea.py +535 -0
  67. pygeodesy/geodesicx/gxbases.py +154 -0
  68. pygeodesy/geodesicx/gxline.py +669 -0
  69. pygeodesy/geodsolve.py +426 -0
  70. pygeodesy/geohash.py +914 -0
  71. pygeodesy/geoids.py +1884 -0
  72. pygeodesy/hausdorff.py +892 -0
  73. pygeodesy/heights.py +1155 -0
  74. pygeodesy/interns.py +687 -0
  75. pygeodesy/iters.py +545 -0
  76. pygeodesy/karney.py +919 -0
  77. pygeodesy/ktm.py +633 -0
  78. pygeodesy/latlonBase.py +1766 -0
  79. pygeodesy/lazily.py +960 -0
  80. pygeodesy/lcc.py +684 -0
  81. pygeodesy/ltp.py +1107 -0
  82. pygeodesy/ltpTuples.py +1563 -0
  83. pygeodesy/mgrs.py +721 -0
  84. pygeodesy/named.py +1324 -0
  85. pygeodesy/namedTuples.py +683 -0
  86. pygeodesy/nvectorBase.py +695 -0
  87. pygeodesy/osgr.py +781 -0
  88. pygeodesy/points.py +1686 -0
  89. pygeodesy/props.py +628 -0
  90. pygeodesy/resections.py +1048 -0
  91. pygeodesy/rhumb/__init__.py +46 -0
  92. pygeodesy/rhumb/aux_.py +397 -0
  93. pygeodesy/rhumb/bases.py +1148 -0
  94. pygeodesy/rhumb/ekx.py +563 -0
  95. pygeodesy/rhumb/solve.py +572 -0
  96. pygeodesy/simplify.py +647 -0
  97. pygeodesy/solveBase.py +472 -0
  98. pygeodesy/sphericalBase.py +724 -0
  99. pygeodesy/sphericalNvector.py +1264 -0
  100. pygeodesy/sphericalTrigonometry.py +1447 -0
  101. pygeodesy/streprs.py +627 -0
  102. pygeodesy/trf.py +2079 -0
  103. pygeodesy/triaxials.py +1484 -0
  104. pygeodesy/units.py +969 -0
  105. pygeodesy/unitsBase.py +349 -0
  106. pygeodesy/ups.py +538 -0
  107. pygeodesy/utily.py +1231 -0
  108. pygeodesy/utm.py +762 -0
  109. pygeodesy/utmups.py +318 -0
  110. pygeodesy/utmupsBase.py +517 -0
  111. pygeodesy/vector2d.py +785 -0
  112. pygeodesy/vector3d.py +968 -0
  113. pygeodesy/vector3dBase.py +1049 -0
  114. pygeodesy/webmercator.py +383 -0
  115. pygeodesy/wgrs.py +439 -0
@@ -0,0 +1,403 @@
1
+
2
+ # -*- coding: utf-8 -*-
3
+
4
+ u'''Ellipsoidal, I{Karney}-based geodesy.
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.
11
+
12
+ Here's an example usage of C{ellipsoidalKarney}:
13
+
14
+ >>> from pygeodesy.ellipsoidalKarney import LatLon
15
+ >>> Newport_RI = LatLon(41.49008, -71.312796)
16
+ >>> Cleveland_OH = LatLon(41.499498, -81.695391)
17
+ >>> Newport_RI.distanceTo(Cleveland_OH)
18
+ 866,455.4329098687 # meter
19
+
20
+ You can change the ellipsoid model used by the I{Karney} formulae
21
+ as follows:
22
+
23
+ >>> from pygeodesy import Datums
24
+ >>> from pygeodesy.ellipsoidalKarney import LatLon
25
+ >>> p = LatLon(0, 0, datum=Datums.OSGB36)
26
+
27
+ or by converting to anothor datum:
28
+
29
+ >>> p = p.toDatum(Datums.OSGB36)
30
+ '''
31
+
32
+ from pygeodesy.datums import _WGS84
33
+ from pygeodesy.ellipsoidalBase import CartesianEllipsoidalBase, _nearestOn
34
+ from pygeodesy.ellipsoidalBaseDI import LatLonEllipsoidalBaseDI, \
35
+ _intersection3, _intersections2, \
36
+ _TOL_M, intersecant2
37
+ # from pygeodesy.errors import _xkwds # from .karney
38
+ from pygeodesy.karney import _polygon, fabs, _xkwds
39
+ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
40
+ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
41
+ from pygeodesy.props import deprecated_method, Property_RO
42
+
43
+ # from math import fabs # from .karney
44
+
45
+ __all__ = _ALL_LAZY.ellipsoidalKarney
46
+ __version__ = '24.02.21'
47
+
48
+
49
+ class Cartesian(CartesianEllipsoidalBase):
50
+ '''Extended to convert C{Karney}-based L{Cartesian} to
51
+ C{Karney}-based L{LatLon} points.
52
+ '''
53
+
54
+ def toLatLon(self, **LatLon_and_kwds): # PYCHOK LatLon=LatLon, datum=None
55
+ '''Convert this cartesian point to a C{Karney}-based geodetic point.
56
+
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}.
61
+
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.
65
+
66
+ @raise TypeError: Invalid B{C{LatLon_and_kwds}} argument.
67
+ '''
68
+ kwds = _xkwds(LatLon_and_kwds, LatLon=LatLon, datum=self.datum)
69
+ return CartesianEllipsoidalBase.toLatLon(self, **kwds)
70
+
71
+
72
+ 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.
80
+ '''
81
+
82
+ @deprecated_method
83
+ def bearingTo(self, other, wrap=False): # PYCHOK no cover
84
+ '''DEPRECATED, use method L{initialBearingTo}.
85
+ '''
86
+ return self.initialBearingTo(other, wrap=wrap)
87
+
88
+ @Property_RO
89
+ def Equidistant(self):
90
+ '''Get the prefered azimuthal equidistant projection I{class} (L{EquidistantKarney}).
91
+ '''
92
+ return _MODS.azimuthal.EquidistantKarney
93
+
94
+ @Property_RO
95
+ def geodesic(self):
96
+ '''Get this C{LatLon}'s I{wrapped} U{geodesic.Geodesic
97
+ <https://GeographicLib.SourceForge.io/Python/doc/code.html>}, provided
98
+ I{Karney}'s U{geographiclib<https://PyPI.org/project/geographiclib>}
99
+ package is installed.
100
+ '''
101
+ return self.datum.ellipsoid.geodesic
102
+
103
+ def toCartesian(self, **Cartesian_datum_kwds): # PYCHOK Cartesian=Cartesian, datum=None
104
+ '''Convert this point to C{Karney}-based cartesian (ECEF) coordinates.
105
+
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
109
+ or set C{B{Cartesian} is None}.
110
+
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.
115
+
116
+ @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}} or other
117
+ B{C{Cartesian_datum_kwds}}.
118
+ '''
119
+ kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
120
+ return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
121
+
122
+
123
+ def areaOf(points, datum=_WGS84, wrap=True):
124
+ '''Compute the area of an (ellipsoidal) polygon or composite.
125
+
126
+ @arg points: The polygon points (L{LatLon}[], L{BooleanFHP}
127
+ or L{BooleanGH}).
128
+ @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}).
131
+
132
+ @return: Area (C{meter}, same as units of the B{C{datum}}'s
133
+ ellipsoid axes, I{squared}).
134
+
135
+ @raise ImportError: Package U{geographiclib
136
+ <https://PyPI.org/project/geographiclib>}
137
+ not installed or not found.
138
+
139
+ @raise PointsError: Insufficient number of B{C{points}}.
140
+
141
+ @raise TypeError: Some B{C{points}} are not L{LatLon}.
142
+
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.
148
+
149
+ @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf},
150
+ L{ellipsoidalGeodSolve.areaOf}, L{sphericalNvector.areaOf}
151
+ and L{sphericalTrigonometry.areaOf}.
152
+
153
+ @note: The U{area of a polygon enclosing a pole<https://GeographicLib.SourceForge.io/
154
+ C++/doc/classGeographicLib_1_1GeodesicExact.html#a3d7a9155e838a09a48dc14d0c3fac525>}
155
+ can be found by adding half the datum's ellipsoid surface area to the polygon's area.
156
+ '''
157
+ return fabs(_polygon(datum.ellipsoid.geodesic, points, True, False, wrap))
158
+
159
+
160
+ def intersection3(start1, end1, start2, end2, height=None, wrap=False, # was=True
161
+ equidistant=None, tol=_TOL_M, LatLon=LatLon, **LatLon_kwds):
162
+ '''I{Iteratively} compute the intersection point of two lines, each defined
163
+ by two (ellipsoidal) points or by an (ellipsoidal) start point and an
164
+ (initial) bearing from North.
165
+
166
+ @arg start1: Start point of the first line (L{LatLon}).
167
+ @arg end1: End point of the first line (L{LatLon}) or the initial bearing
168
+ at the first point (compass C{degrees360}).
169
+ @arg start2: Start point of the second line (L{LatLon}).
170
+ @arg end2: End point of the second line (L{LatLon}) or the initial bearing
171
+ at the second point (compass C{degrees360}).
172
+ @kwarg height: Optional height at the intersection (C{meter}, conventionally)
173
+ or C{None} for the mean height.
174
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{start2}}
175
+ and B{C{end*}} points (C{bool}).
176
+ @kwarg equidistant: An azimuthal equidistant projection (I{class} or function
177
+ L{pygeodesy.equidistant}) or C{None} for the preferred
178
+ C{B{start1}.Equidistant}.
179
+ @kwarg tol: Tolerance for convergence and for skew line distance and length
180
+ (C{meter}, conventionally).
181
+ @kwarg LatLon: Optional class to return the intersection points (L{LatLon})
182
+ or C{None}.
183
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword arguments,
184
+ ignored if C{B{LatLon} is None}.
185
+
186
+ @return: An L{Intersection3Tuple}C{(point, outside1, outside2)} with C{point}
187
+ a B{C{LatLon}} or if C{B{LatLon} is None}, a L{LatLon4Tuple}C{(lat,
188
+ lon, height, datum)}.
189
+
190
+ @raise IntersectionError: Skew, colinear, parallel or otherwise
191
+ non-intersecting lines or no convergence
192
+ for the given B{C{tol}}.
193
+
194
+ @raise TypeError: Invalid or non-ellipsoidal B{C{start1}}, B{C{end1}},
195
+ B{C{start2}} or B{C{end2}} or invalid B{C{equidistant}}.
196
+
197
+ @note: For each line specified with an initial bearing, a pseudo-end point
198
+ is computed as the C{destination} along that bearing at about 1.5
199
+ times the distance from the start point to an initial gu-/estimate
200
+ of the intersection point (and between 1/8 and 3/8 of the authalic
201
+ earth perimeter).
202
+
203
+ @see: U{The B{ellipsoidal} case<https://GIS.StackExchange.com/questions/48937/
204
+ calculating-intersection-of-two-circles>} and U{Karney's paper
205
+ <https://ArXiv.org/pdf/1102.1215.pdf>}, pp 20-21, section B{14. MARITIME
206
+ BOUNDARIES} for more details about the iteration algorithm.
207
+ '''
208
+ return _intersection3(start1, end1, start2, end2, height=height, wrap=wrap,
209
+ equidistant=equidistant, tol=tol, LatLon=LatLon, **LatLon_kwds)
210
+
211
+
212
+ def intersections2(center1, radius1, center2, radius2, height=None, wrap=False, # was=True
213
+ equidistant=None, tol=_TOL_M, LatLon=LatLon, **LatLon_kwds):
214
+ '''I{Iteratively} compute the intersection points of two circles, each defined
215
+ by an (ellipsoidal) center point and a radius.
216
+
217
+ @arg center1: Center of the first circle (L{LatLon}).
218
+ @arg radius1: Radius of the first circle (C{meter}, conventionally).
219
+ @arg center2: Center of the second circle (L{LatLon}).
220
+ @arg radius2: Radius of the second circle (C{meter}, same units as
221
+ B{C{radius1}}).
222
+ @kwarg height: Optional height for the intersection points (C{meter},
223
+ conventionally) or C{None} for the I{"radical height"}
224
+ at the I{radical line} between both centers.
225
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll B{C{center2}}
226
+ (C{bool}).
227
+ @kwarg equidistant: An azimuthal equidistant projection (I{class} or
228
+ function L{pygeodesy.equidistant}) or C{None} for
229
+ the preferred C{B{center1}.Equidistant}.
230
+ @kwarg tol: Convergence tolerance (C{meter}, same units as B{C{radius1}}
231
+ and B{C{radius2}}).
232
+ @kwarg LatLon: Optional class to return the intersection points (L{LatLon})
233
+ or C{None}.
234
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword arguments,
235
+ ignored if C{B{LatLon} is None}.
236
+
237
+ @return: 2-Tuple of the intersection points, each a B{C{LatLon}} instance
238
+ or L{LatLon4Tuple}C{(lat, lon, height, datum)} if C{B{LatLon} is
239
+ None}. For abutting circles, both points are the same instance,
240
+ aka the I{radical center}.
241
+
242
+ @raise IntersectionError: Concentric, antipodal, invalid or non-intersecting
243
+ circles or no convergence for the B{C{tol}}.
244
+
245
+ @raise TypeError: Invalid or non-ellipsoidal B{C{center1}} or B{C{center2}}
246
+ or invalid B{C{equidistant}}.
247
+
248
+ @raise UnitError: Invalid B{C{radius1}}, B{C{radius2}} or B{C{height}}.
249
+
250
+ @see: U{The B{ellipsoidal} case<https://GIS.StackExchange.com/questions/48937/
251
+ calculating-intersection-of-two-circles>}, U{Karney's paper
252
+ <https://ArXiv.org/pdf/1102.1215.pdf>}, pp 20-21, section B{14. MARITIME BOUNDARIES},
253
+ U{circle-circle<https://MathWorld.Wolfram.com/Circle-CircleIntersection.html>} and
254
+ U{sphere-sphere<https://MathWorld.Wolfram.com/Sphere-SphereIntersection.html>}
255
+ intersections.
256
+ '''
257
+ return _intersections2(center1, radius1, center2, radius2, height=height, wrap=wrap,
258
+ equidistant=equidistant, tol=tol, LatLon=LatLon, **LatLon_kwds)
259
+
260
+
261
+ def isclockwise(points, datum=_WGS84, wrap=True):
262
+ '''Determine the direction of a path or polygon.
263
+
264
+ @arg points: The path or polygon points (C{LatLon}[]).
265
+ @kwarg datum: Optional datum (L{Datum}).
266
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
267
+ B{C{points}} (C{bool}).
268
+
269
+ @return: C{True} if B{C{points}} are clockwise, C{False} otherwise.
270
+
271
+ @raise ImportError: Package U{geographiclib
272
+ <https://PyPI.org/project/geographiclib>}
273
+ not installed or not found.
274
+
275
+ @raise PointsError: Insufficient number of B{C{points}}.
276
+
277
+ @raise TypeError: Some B{C{points}} are not C{LatLon}.
278
+
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.
284
+
285
+ @see: L{pygeodesy.isclockwise}.
286
+ '''
287
+ a = _polygon(datum.ellipsoid.geodesic, points, True, False, wrap)
288
+ if a < 0:
289
+ return True
290
+ elif a > 0:
291
+ return False
292
+ raise _areaError(points)
293
+
294
+
295
+ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
296
+ equidistant=None, tol=_TOL_M, LatLon=LatLon, **LatLon_kwds):
297
+ '''I{Iteratively} locate the closest point on the geodesic between
298
+ two other (ellipsoidal) points.
299
+
300
+ @arg point: Reference point (C{LatLon}).
301
+ @arg point1: Start point of the geodesic (C{LatLon}).
302
+ @arg point2: End point of the geodesic (C{LatLon}).
303
+ @kwarg within: If C{True} return the closest point I{between}
304
+ B{C{point1}} and B{C{point2}}, otherwise the
305
+ closest point elsewhere on the geodesic (C{bool}).
306
+ @kwarg height: Optional height for the closest point (C{meter},
307
+ conventionally) or C{None} or C{False} for the
308
+ interpolated height. If C{False}, the closest
309
+ takes the heights of the points into account.
310
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll both
311
+ B{C{point1}} and B{C{point2}} (C{bool}).
312
+ @kwarg equidistant: An azimuthal equidistant projection (I{class}
313
+ or function L{pygeodesy.equidistant}) or C{None}
314
+ for the preferred C{B{point}.Equidistant}.
315
+ @kwarg tol: Convergence tolerance (C{meter}).
316
+ @kwarg LatLon: Optional class to return the closest point
317
+ (L{LatLon}) or C{None}.
318
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
319
+ arguments, ignored if C{B{LatLon} is None}.
320
+
321
+ @return: Closest point, a B{C{LatLon}} instance or if C{B{LatLon}
322
+ is None}, a L{LatLon4Tuple}C{(lat, lon, height, datum)}.
323
+
324
+ @raise ImportError: Package U{geographiclib
325
+ <https://PyPI.org/project/geographiclib>}
326
+ not installed or not found.
327
+
328
+ @raise TypeError: Invalid or non-ellipsoidal B{C{point}}, B{C{point1}}
329
+ or B{C{point2}} or invalid B{C{equidistant}}.
330
+
331
+ @raise ValueError: No convergence for the B{C{tol}}.
332
+
333
+ @see: U{The B{ellipsoidal} case<https://GIS.StackExchange.com/questions/48937/
334
+ calculating-intersection-of-two-circles>} and U{Karney's paper
335
+ <https://ArXiv.org/pdf/1102.1215.pdf>}, pp 20-21, section B{14. MARITIME
336
+ BOUNDARIES} for more details about the iteration algorithm.
337
+ '''
338
+ return _nearestOn(point, point1, point2, within=within, height=height, wrap=wrap,
339
+ equidistant=equidistant, tol=tol, LatLon=LatLon, **LatLon_kwds)
340
+
341
+
342
+ def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
343
+ '''Compute the perimeter of an (ellipsoidal) polygon or composite.
344
+
345
+ @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
346
+ L{BooleanGH}).
347
+ @kwarg closed: Optionally, close the polygon (C{bool}).
348
+ @kwarg datum: Optional datum (L{Datum}).
349
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
350
+ B{C{points}} (C{bool}).
351
+
352
+ @return: Perimeter (C{meter}, same as units of the B{C{datum}}'s
353
+ ellipsoid axes).
354
+
355
+ @raise ImportError: Package U{geographiclib
356
+ <https://PyPI.org/project/geographiclib>}
357
+ not installed or not found.
358
+
359
+ @raise PointsError: Insufficient number of B{C{points}}.
360
+
361
+ @raise TypeError: Some B{C{points}} are not L{LatLon} or C{B{closed}=False}
362
+ with B{C{points}} a composite.
363
+
364
+ @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
365
+ longitudes not supported or C{B{closed}=False}
366
+ with C{B{points}} a composite.
367
+
368
+ @note: This function requires the U{geographiclib
369
+ <https://PyPI.org/project/geographiclib>} package.
370
+
371
+ @see: Functions L{pygeodesy.perimeterOf}, L{ellipsoidalExact.perimeterOf},
372
+ L{ellipsoidalGeodSolve.perimeterOf}, L{sphericalNvector.perimeterOf}
373
+ and L{sphericalTrigonometry.perimeterOf}.
374
+ '''
375
+ return _polygon(datum.ellipsoid.geodesic, points, closed, True, wrap)
376
+
377
+
378
+ __all__ += _ALL_OTHER(Cartesian, LatLon, # classes
379
+ areaOf, intersecant2, # from .ellipsoidalBase
380
+ intersection3, intersections2, isclockwise, ispolar,
381
+ nearestOn, perimeterOf)
382
+
383
+ # **) MIT License
384
+ #
385
+ # Copyright (C) 2016-2024 -- mrJean1 at Gmail -- All Rights Reserved.
386
+ #
387
+ # Permission is hereby granted, free of charge, to any person obtaining a
388
+ # copy of this software and associated documentation files (the "Software"),
389
+ # to deal in the Software without restriction, including without limitation
390
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
391
+ # and/or sell copies of the Software, and to permit persons to whom the
392
+ # Software is furnished to do so, subject to the following conditions:
393
+ #
394
+ # The above copyright notice and this permission notice shall be included
395
+ # in all copies or substantial portions of the Software.
396
+ #
397
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
398
+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
399
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
400
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
401
+ # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
402
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
403
+ # OTHER DEALINGS IN THE SOFTWARE.