pygeodesy 24.8.4__py2.py3-none-any.whl → 24.8.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 (50) hide show
  1. {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.8.24.dist-info}/METADATA +16 -15
  2. {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.8.24.dist-info}/RECORD +50 -50
  3. {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.8.24.dist-info}/WHEEL +1 -1
  4. pygeodesy/__init__.py +23 -23
  5. pygeodesy/auxilats/auxDST.py +2 -2
  6. pygeodesy/basics.py +3 -3
  7. pygeodesy/cartesianBase.py +5 -5
  8. pygeodesy/constants.py +11 -11
  9. pygeodesy/ellipsoidalBase.py +18 -15
  10. pygeodesy/ellipsoidalExact.py +2 -2
  11. pygeodesy/ellipsoidalGeodSolve.py +2 -2
  12. pygeodesy/ellipsoidalKarney.py +2 -2
  13. pygeodesy/ellipsoidalNvector.py +2 -2
  14. pygeodesy/ellipsoidalVincenty.py +7 -6
  15. pygeodesy/epsg.py +3 -3
  16. pygeodesy/fmath.py +2 -1
  17. pygeodesy/fsums.py +4 -4
  18. pygeodesy/gars.py +9 -8
  19. pygeodesy/geodesicx/gx.py +3 -3
  20. pygeodesy/geodesicx/gxarea.py +3 -3
  21. pygeodesy/geodsolve.py +3 -3
  22. pygeodesy/geohash.py +18 -11
  23. pygeodesy/geoids.py +293 -315
  24. pygeodesy/heights.py +150 -158
  25. pygeodesy/internals.py +21 -1
  26. pygeodesy/interns.py +2 -3
  27. pygeodesy/latlonBase.py +13 -7
  28. pygeodesy/lazily.py +6 -6
  29. pygeodesy/ltp.py +5 -6
  30. pygeodesy/ltpTuples.py +7 -1
  31. pygeodesy/named.py +5 -4
  32. pygeodesy/namedTuples.py +14 -1
  33. pygeodesy/osgr.py +7 -7
  34. pygeodesy/points.py +2 -2
  35. pygeodesy/resections.py +7 -7
  36. pygeodesy/rhumb/solve.py +3 -3
  37. pygeodesy/simplify.py +10 -10
  38. pygeodesy/sphericalBase.py +3 -3
  39. pygeodesy/sphericalTrigonometry.py +2 -2
  40. pygeodesy/streprs.py +3 -3
  41. pygeodesy/triaxials.py +207 -201
  42. pygeodesy/units.py +3 -3
  43. pygeodesy/unitsBase.py +4 -4
  44. pygeodesy/utmupsBase.py +3 -3
  45. pygeodesy/vector2d.py +158 -51
  46. pygeodesy/vector3d.py +13 -52
  47. pygeodesy/vector3dBase.py +81 -63
  48. pygeodesy/webmercator.py +3 -3
  49. pygeodesy/wgrs.py +20 -22
  50. {PyGeodesy-24.8.4.dist-info → PyGeodesy-24.8.24.dist-info}/top_level.txt +0 -0
@@ -35,7 +35,7 @@ from pygeodesy.units import Epoch, _isDegrees, Radius_, _1mm as _TOL_M
35
35
  # from math import fabs # from .latlonBase
36
36
 
37
37
  __all__ = _ALL_LAZY.ellipsoidalBase
38
- __version__ = '24.06.24'
38
+ __version__ = '24.08.14'
39
39
 
40
40
 
41
41
  class CartesianEllipsoidalBase(CartesianBase):
@@ -111,7 +111,7 @@ class CartesianEllipsoidalBase(CartesianBase):
111
111
  C{Vector3Tuple} or C{Vector4Tuple}).
112
112
  @arg radius2: Radius of the second sphere or circle (same units as this and
113
113
  the B{C{other}} point's coordinates).
114
- @kwarg sphere: If C{True} compute the center and radius of the intersection
114
+ @kwarg sphere: If C{True}, compute the center and radius of the intersection
115
115
  of two I{spheres}. If C{False}, ignore the C{z}-component and
116
116
  compute the intersection of two I{circles} (C{bool}).
117
117
  @kwarg Vector: Class to return intersections (C{Cartesian}, L{Vector3d} or
@@ -527,7 +527,7 @@ class LatLonEllipsoidalBase(LatLonBase):
527
527
  point is computed as the C{destination} along that bearing at
528
528
  about 1.5 times the distance from the start point to an initial
529
529
  gu-/estimate of the intersection point (and between 1/8 and 3/8
530
- of the authalic earth perimeter).
530
+ of the C{authalic} earth perimeter).
531
531
 
532
532
  @see: I{Karney's} U{intersect.cpp<https://SourceForge.net/p/geographiclib/
533
533
  discussion/1026621/thread/21aaff9f/>}, U{The B{ellipsoidal} case<https://
@@ -659,7 +659,7 @@ class LatLonEllipsoidalBase(LatLonBase):
659
659
 
660
660
  @arg point1: Start point (C{LatLon}).
661
661
  @arg point2: End point (C{LatLon}).
662
- @kwarg within: If C{True} return the closest point I{between}
662
+ @kwarg within: If C{True}, return the closest point I{between}
663
663
  B{C{point1}} and B{C{point2}}, otherwise the
664
664
  closest point elsewhere on the geodesic (C{bool}).
665
665
  @kwarg height: Optional height for the closest point (C{meter},
@@ -714,8 +714,8 @@ class LatLonEllipsoidalBase(LatLonBase):
714
714
  I{without conversion}.
715
715
  @kwarg epoch: Optional datum (L{Epoch}), overriding this epoch
716
716
  I{without conversion}.
717
- @kwarg reframe: Optional datum (L{RefFrame}), overriding this
718
- reframe I{without conversion}.
717
+ @kwarg reframe: Optional reference frame (L{RefFrame}), overriding
718
+ this reframe I{without conversion}.
719
719
  @kwarg sep: Optional separator (C{str}).
720
720
  @kwarg wrap: If C{True}, wrap or I{normalize} the lat- and
721
721
  longitude (C{bool}).
@@ -726,7 +726,8 @@ class LatLonEllipsoidalBase(LatLonBase):
726
726
  @raise ParseError: Invalid B{C{strllh}}.
727
727
  '''
728
728
  a, b, h = _MODS.dms.parse3llh(strllh, height=height, sep=sep, wrap=wrap)
729
- r = self.classof(a, b, height=h, datum=self.datum)
729
+ r = self.classof(a, b, height=h, datum=self.datum, epoch=self.epoch,
730
+ reframe=self.reframe)
730
731
  if datum not in (None, self.datum):
731
732
  r.datum = datum
732
733
  if epoch not in (None, self.epoch):
@@ -865,7 +866,7 @@ class LatLonEllipsoidalBase(LatLonBase):
865
866
  def toOsgr(self, kTM=False, **toOsgr_kwds):
866
867
  '''Convert this C{LatLon} point to an OSGR coordinate.
867
868
 
868
- @kwarg kTM: If C{True} use I{Karney}'s Krüger method from module
869
+ @kwarg kTM: If C{True}, use I{Karney}'s Krüger method from module
869
870
  L{ktm}, otherwise I{Ordinance Survery}'s recommended
870
871
  formulation (C{bool}).
871
872
  @kwarg toOsgr_kwds: Optional L{pygeodesy.toOsgr} keyword arguments.
@@ -1008,13 +1009,15 @@ class LatLonEllipsoidalBase(LatLonBase):
1008
1009
 
1009
1010
  @arg bearing1: Bearing at this point (compass C{degrees360}).
1010
1011
  @arg other: Start point of the other line (C{LatLon}).
1011
- @arg bearing2: Bearing at the other point (compass C{degrees360}).
1012
+ @arg bearing2: Bearing at the B{C{other}} point (compass C{degrees360}).
1012
1013
  @kwarg height_wrap_tol: Optional keyword arguments C{B{height}=None},
1013
- C{B{wrap}=False} and C{B{tol}}, see method L{intersection3}.
1014
+ C{B{wrap}=False} and C{B{tol}}, see method L{intersection3
1015
+ <pygeodesy.ellipsoidalBase.LatLonEllipsoidalBase>}.
1014
1016
 
1015
1017
  @return: Triangulated point (C{LatLon}).
1016
1018
 
1017
- @see: Method L{intersection3} for further details.
1019
+ @see: Method L{intersection3<pygeodesy.ellipsoidalBase.LatLonEllipsoidalBase>}
1020
+ for further details.
1018
1021
  '''
1019
1022
  if _isDegrees(bearing1) and _isDegrees(bearing2):
1020
1023
  r = self.intersection3(bearing1, other, bearing2, **height_wrap_tol)
@@ -1034,13 +1037,13 @@ class LatLonEllipsoidalBase(LatLonBase):
1034
1037
  @arg point3: Third center point (C{LatLon}).
1035
1038
  @arg distance3: Distance to point3 (C{meter}, same units as
1036
1039
  B{C{eps}}).
1037
- @kwarg area: If C{True} compute the area overlap, otherwise the
1040
+ @kwarg area: If C{True}, compute the area overlap, otherwise the
1038
1041
  perimeter intersection of the circles (C{bool}).
1039
1042
  @kwarg eps: The required I{minimal overlap} for C{B{area}=True}
1040
1043
  or the I{intersection margin} for C{B{area}=False}
1041
1044
  (C{meter}, conventionally).
1042
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll
1043
- B{C{point2}} and B{C{point3}} (C{bool}).
1045
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll B{C{point2}}
1046
+ and B{C{point3}} (C{bool}).
1044
1047
 
1045
1048
  @return: A L{Trilaterate5Tuple}C{(min, minPoint, max, maxPoint, n)}
1046
1049
  with C{min} and C{max} in C{meter}, same units as B{C{eps}},
@@ -1049,7 +1052,7 @@ class LatLonEllipsoidalBase(LatLonBase):
1049
1052
  of trilatered points found for the given B{C{eps}}.
1050
1053
 
1051
1054
  If only a single trilaterated point is found, C{min I{is}
1052
- max}, C{minPoint I{is} maxPoint} and C{n = 1}.
1055
+ max}, C{minPoint I{is} maxPoint} and C{n=1}.
1053
1056
 
1054
1057
  For C{B{area}=True}, C{min} and C{max} are the smallest
1055
1058
  respectively largest I{radial} overlap found.
@@ -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__ = '24.06.11'
27
+ __version__ = '24.08.13'
28
28
 
29
29
 
30
30
  class Cartesian(CartesianEllipsoidalBase):
@@ -252,7 +252,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
252
252
  @arg point: Reference point (C{LatLon}).
253
253
  @arg point1: Start point of the geodesic (C{LatLon}).
254
254
  @arg point2: End point of the geodesic (C{LatLon}).
255
- @kwarg within: If C{True} return the closest point I{between}
255
+ @kwarg within: If C{True}, return the closest point I{between}
256
256
  B{C{point1}} and B{C{point2}}, otherwise the
257
257
  closest point elsewhere on the geodesic (C{bool}).
258
258
  @kwarg height: Optional height for the closest point (C{meter},
@@ -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.06.11'
27
+ __version__ = '24.08.13'
28
28
 
29
29
 
30
30
  class Cartesian(CartesianEllipsoidalBase):
@@ -244,7 +244,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
244
244
  @arg point: Reference point (C{LatLon}).
245
245
  @arg point1: Start point of the geodesic (C{LatLon}).
246
246
  @arg point2: End point of the geodesic (C{LatLon}).
247
- @kwarg within: If C{True} return the closest point I{between}
247
+ @kwarg within: If C{True}, return the closest point I{between}
248
248
  B{C{point1}} and B{C{point2}}, otherwise the
249
249
  closest point elsewhere on the geodesic (C{bool}).
250
250
  @kwarg height: Optional height for the closest point (C{meter},
@@ -42,7 +42,7 @@ from pygeodesy.props import deprecated_method, Property_RO
42
42
  # from math import fabs # from .karney
43
43
 
44
44
  __all__ = _ALL_LAZY.ellipsoidalKarney
45
- __version__ = '24.06.11'
45
+ __version__ = '24.08.13'
46
46
 
47
47
 
48
48
  class Cartesian(CartesianEllipsoidalBase):
@@ -279,7 +279,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
279
279
  @arg point: Reference point (C{LatLon}).
280
280
  @arg point1: Start point of the geodesic (C{LatLon}).
281
281
  @arg point2: End point of the geodesic (C{LatLon}).
282
- @kwarg within: If C{True} return the closest point I{between}
282
+ @kwarg within: If C{True}, return the closest point I{between}
283
283
  B{C{point1}} and B{C{point2}}, otherwise the
284
284
  closest point elsewhere on the geodesic (C{bool}).
285
285
  @kwarg height: Optional height for the closest point (C{meter},
@@ -48,7 +48,7 @@ from pygeodesy.units import Bearing, Distance, Height, Scalar
48
48
  # from math import fabs # from .nvectorBase
49
49
 
50
50
  __all__ = _ALL_LAZY.ellipsoidalNvector
51
- __version__ = '24.06.15'
51
+ __version__ = '24.08.13'
52
52
 
53
53
 
54
54
  class Ned(_Ned):
@@ -555,7 +555,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
555
555
  @arg point: Reference point (C{LatLon}).
556
556
  @arg point1: Start point of the geodesic (C{LatLon}).
557
557
  @arg point2: End point of the geodesic (C{LatLon}).
558
- @kwarg within: If C{True} return the closest point I{between}
558
+ @kwarg within: If C{True}, return the closest point I{between}
559
559
  B{C{point1}} and B{C{point2}}, otherwise the
560
560
  closest point elsewhere on the geodesic (C{bool}).
561
561
  @kwarg height: Optional height for the closest point (C{meter},
@@ -59,7 +59,7 @@ from pygeodesy.errors import _and, _ValueError, _xkwds
59
59
  from pygeodesy.fmath import Fpolynomial, hypot, hypot1
60
60
  from pygeodesy.interns import _ambiguous_, _antipodal_, _COLONSPACE_, \
61
61
  _to_, _SPACE_, _limit_ # PYCHOK used!
62
- from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
62
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
63
63
  from pygeodesy.namedTuples import Destination2Tuple, Destination3Tuple, \
64
64
  Distance3Tuple
65
65
  from pygeodesy.points import Fmt, ispolar # PYCHOK exported
@@ -72,7 +72,7 @@ from pygeodesy.utily import atan2b, atan2d, sincos2, sincos2d, unroll180, wrap18
72
72
  from math import atan2, cos, degrees, fabs, radians, tan
73
73
 
74
74
  __all__ = _ALL_LAZY.ellipsoidalVincenty
75
- __version__ = '24.06.11'
75
+ __version__ = '24.08.13'
76
76
 
77
77
  _antipodal_to_ = _SPACE_(_antipodal_, _to_)
78
78
 
@@ -510,7 +510,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
510
510
  @arg point: Reference point (C{LatLon}).
511
511
  @arg point1: Start point of the geodesic (C{LatLon}).
512
512
  @arg point2: End point of the geodesic (C{LatLon}).
513
- @kwarg within: If C{True} return the closest point I{between}
513
+ @kwarg within: If C{True}, return the closest point I{between}
514
514
  B{C{point1}} and B{C{point2}}, otherwise the
515
515
  closest point elsewhere on the geodesic (C{bool}).
516
516
  @kwarg height: Optional height for the closest point (C{meter},
@@ -560,9 +560,10 @@ def perimeterOf(points, **closed_datum_wrap):
560
560
  return _MODS.ellipsoidalExact.perimeterOf(points, **closed_datum_wrap)
561
561
 
562
562
 
563
- __all__ += _ALL_OTHER(Cartesian, LatLon, intersecant2, # from .ellipsoidalBaseDI
564
- intersection3, intersections2, ispolar, # from .points
565
- nearestOn) + _ALL_DOCS(areaOf, perimeterOf) # deprecated
563
+ __all__ += _ALL_DOCS(Cartesian, LatLon, intersecant2, # from .ellipsoidalBaseDI
564
+ intersection3, intersections2, ispolar, # from .points
565
+ nearestOn,
566
+ areaOf, perimeterOf) # DEPRECATED
566
567
 
567
568
  # **) MIT License
568
569
  #
pygeodesy/epsg.py CHANGED
@@ -17,7 +17,7 @@ including coverage of UPS as zone C{0}.
17
17
  from pygeodesy.basics import isint, isstr, _xinstanceof
18
18
  from pygeodesy.errors import _ValueError
19
19
  from pygeodesy.interns import NN, _N_, _NS_, _S_, _SPACE_
20
- from pygeodesy.lazily import _ALL_LAZY, _ALL_OTHER
20
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
21
21
  from pygeodesy.namedTuples import UtmUps2Tuple
22
22
  from pygeodesy.props import Property_RO
23
23
  from pygeodesy.streprs import Fmt
@@ -28,7 +28,7 @@ from pygeodesy.utmupsBase import _to3zBhp, _UPS_ZONE, _UTM_ZONE_MIN, \
28
28
  _UTM_ZONE_MAX, _UTMUPS_ZONE_INVALID
29
29
 
30
30
  __all__ = _ALL_LAZY.epsg
31
- __version__ = '24.05.18'
31
+ __version__ = '24.08.05'
32
32
 
33
33
  # _EPSG_INVALID = _UTMUPS_ZONE_INVALID
34
34
  _EPSG_N_01 = 32601 # EPSG code for UTM zone 01 N
@@ -219,7 +219,7 @@ def encode(zone, hemipole=NN, band=NN):
219
219
  return e
220
220
 
221
221
 
222
- __all__ += _ALL_OTHER(decode2, encode)
222
+ __all__ += _ALL_DOCS(decode2, encode)
223
223
 
224
224
  # **) MIT License
225
225
  #
pygeodesy/fmath.py CHANGED
@@ -24,7 +24,7 @@ from math import fabs, sqrt # pow
24
24
  import operator as _operator # in .datums, .trf, .utm
25
25
 
26
26
  __all__ = _ALL_LAZY.fmath
27
- __version__ = '24.05.29'
27
+ __version__ = '24.08.15'
28
28
 
29
29
  # sqrt(2) <https://WikiPedia.org/wiki/Square_root_of_2>
30
30
  _0_4142 = 0.41421356237309504880 # ... sqrt(2) - 1
@@ -886,6 +886,7 @@ def norm2(x, y):
886
886
  or zero norm.
887
887
  '''
888
888
  try:
889
+ h = None
889
890
  h = hypot(x, y)
890
891
  if h:
891
892
  x, y = (x / h), (y / h)
pygeodesy/fsums.py CHANGED
@@ -47,7 +47,7 @@ from pygeodesy.streprs import Fmt, fstr, unstr
47
47
  from math import ceil as _ceil, fabs, floor as _floor # PYCHOK used! .ltp
48
48
 
49
49
  __all__ = _ALL_LAZY.fsums
50
- __version__ = '24.06.11'
50
+ __version__ = '24.08.13'
51
51
 
52
52
  _add_op_ = _PLUS_ # in .auxilats.auxAngle
53
53
  _eq_op_ = _EQUAL_ * 2 # _DEQUAL_
@@ -1970,8 +1970,8 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase
1970
1970
  def signOf(self, res=True):
1971
1971
  '''Determine the sign of this instance.
1972
1972
 
1973
- @kwarg res: If C{True} consider, otherwise
1974
- ignore the residual (C{bool}).
1973
+ @kwarg res: If C{True}, consider, otherwise ignore
1974
+ the residual (C{bool}).
1975
1975
 
1976
1976
  @return: The sign (C{int}, -1, 0 or +1).
1977
1977
  '''
@@ -1992,7 +1992,7 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase
1992
1992
  def toStr(self, lenc=True, **prec_sep_fmt): # PYCHOK signature
1993
1993
  '''Return this C{Fsum} instance as string.
1994
1994
 
1995
- @kwarg lenc: If C{True} include the current C{[len]} of this
1995
+ @kwarg lenc: If C{True}, include the current C{[len]} of this
1996
1996
  L{Fsum} enclosed in I{[brackets]} (C{bool}).
1997
1997
  @kwarg prec_sep_fmt: Optional keyword arguments for method
1998
1998
  L{Fsum2Tuple.toStr}.
pygeodesy/gars.py CHANGED
@@ -18,8 +18,9 @@ Transcoded from I{Charles Karney}'s C++ class U{GARS
18
18
  from pygeodesy.constants import _off90, _1_over, _0_5, \
19
19
  _1_0 # PYCHOK used!
20
20
  from pygeodesy.errors import _ValueError, _xkwds, _xStrError
21
- from pygeodesy.interns import NN, _0to9_, _AtoZnoIO_, _COMMA_, _SPACE_
22
- from pygeodesy.lazily import _ALL_LAZY, _ALL_OTHER
21
+ from pygeodesy.interns import NN, _0to9_, _AtoZnoIO_, _COMMA_, \
22
+ _INV_, _SPACE_
23
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
23
24
  from pygeodesy.named import _name__, Fmt, isstr, Property_RO
24
25
  from pygeodesy.namedTuples import LatLon2Tuple, LatLonPrec3Tuple
25
26
  # from pygeodesy.props import Property_RO # from .named
@@ -29,7 +30,7 @@ from pygeodesy.units import Int_, Lat, Lon, Precision_, Scalar_, Str
29
30
  from math import floor
30
31
 
31
32
  __all__ = _ALL_LAZY.gars
32
- __version__ = '24.08.02'
33
+ __version__ = '24.08.13'
33
34
 
34
35
  _Digits = _0to9_
35
36
  _LatLen = 2
@@ -86,7 +87,7 @@ def _2garstr2(garef):
86
87
  try:
87
88
  n, garstr = len(garef), garef.upper()
88
89
  if n < _MinLen or n > _MaxLen \
89
- or garstr[:3] == 'INV' \
90
+ or garstr.startswith(_INV_) \
90
91
  or not garstr.isalnum():
91
92
  raise ValueError()
92
93
  return garstr, _2Precision(n - _MinLen)
@@ -200,8 +201,8 @@ def decode3(garef, center=True, **name):
200
201
  '''Decode a C{garef} to lat-, longitude and precision.
201
202
 
202
203
  @arg garef: To be decoded (L{Garef} or C{str}).
203
- @kwarg center: If C{True} the center, otherwise the south-west,
204
- lower-left corner (C{bool}).
204
+ @kwarg center: If C{True}, use the garef's center, otherwise
205
+ the south-west, lower-left corner (C{bool}).
205
206
 
206
207
  @return: A L{LatLonPrec3Tuple}C{(lat, lon, precision)}.
207
208
 
@@ -339,8 +340,8 @@ def resolution(prec):
339
340
  return _Resolutions[max(0, min(p, _MaxPrec))]
340
341
 
341
342
 
342
- __all__ += _ALL_OTHER(decode3, # functions
343
- encode, precision, resolution)
343
+ __all__ += _ALL_DOCS(decode3, # functions
344
+ encode, precision, resolution)
344
345
 
345
346
  # **) MIT License
346
347
  #
pygeodesy/geodesicx/gx.py CHANGED
@@ -63,7 +63,7 @@ from pygeodesy.utily import atan2d as _atan2d_reverse, _unrollon, _Wrap, wrap360
63
63
  from math import atan2, copysign, cos, degrees, fabs, radians, sqrt
64
64
 
65
65
  __all__ = ()
66
- __version__ = '24.07.11'
66
+ __version__ = '24.08.13'
67
67
 
68
68
  _MAXIT1 = 20
69
69
  _MAXIT2 = 10 + _MAXIT1 + MANT_DIG # MANT_DIG == C++ digits
@@ -218,8 +218,8 @@ class GeodesicExact(_GeodesicBase):
218
218
  '''Set up a L{GeodesicAreaExact} to compute area and
219
219
  perimeter of a polygon.
220
220
 
221
- @kwarg polyline: If C{True} perimeter only, otherwise
222
- area and perimeter (C{bool}).
221
+ @kwarg polyline: If C{True}, compute the perimeter only, otherwise
222
+ the perimeter and area (C{bool}).
223
223
  @kwarg name: Optional C{B{name}=NN} (C{str}).
224
224
 
225
225
  @return: A L{GeodesicAreaExact} instance.
@@ -30,7 +30,7 @@ from pygeodesy.props import Property, Property_RO, property_RO
30
30
  from math import fmod as _fmod
31
31
 
32
32
  __all__ = ()
33
- __version__ = '24.05.19'
33
+ __version__ = '24.08.13'
34
34
 
35
35
 
36
36
  class GeodesicAreaExact(_NamedBase):
@@ -413,8 +413,8 @@ class PolygonArea(GeodesicAreaExact):
413
413
 
414
414
  @arg earth: A geodesic (L{GeodesicExact}, I{wrapped}
415
415
  C{Geodesic} or L{GeodesicSolve}).
416
- @kwarg polyline: If C{True} perimeter only, otherwise
417
- area and perimeter (C{bool}).
416
+ @kwarg polyline: If C{True}, compute the perimeter only, otherwise
417
+ perimeter and area (C{bool}).
418
418
  @kwarg name: Optional C{B{name}=NN} (C{str}).
419
419
 
420
420
  @raise GeodesicError: Invalid B{C{earth}}.
pygeodesy/geodsolve.py CHANGED
@@ -24,7 +24,7 @@ from pygeodesy.solveBase import _SolveGDictBase, _SolveGDictLineBase
24
24
  from pygeodesy.utily import _unrollon, _Wrap, wrap360
25
25
 
26
26
  __all__ = _ALL_LAZY.geodsolve
27
- __version__ = '24.07.11'
27
+ __version__ = '24.08.13'
28
28
 
29
29
 
30
30
  class _GeodesicSolveBase(_SolveGDictBase):
@@ -101,8 +101,8 @@ class GeodesicSolve(_GeodesicSolveBase):
101
101
  '''Set up a L{GeodesicAreaExact} to compute area and perimeter
102
102
  of a polygon.
103
103
 
104
- @kwarg polyline: If C{True} perimeter only, otherwise area
105
- and perimeter (C{bool}).
104
+ @kwarg polyline: If C{True}, compute the perimeter only, otherwise
105
+ perimeter and area (C{bool}).
106
106
  @kwarg name: Optional C{B{name}=NN} (C{str}).
107
107
 
108
108
  @return: A L{GeodesicAreaExact} instance.
pygeodesy/geohash.py CHANGED
@@ -24,7 +24,7 @@ from pygeodesy.errors import _ValueError, _xkwds, _xStrError
24
24
  # from pygeodesy import formy as _formy # _MODS
25
25
  from pygeodesy.interns import NN, _COMMA_, _DOT_, _E_, _height_, _N_, _NE_, \
26
26
  _NW_, _radius_, _S_, _SE_, _SPACE_, _SW_, _W_, \
27
- _width_
27
+ _width_ # _INV_
28
28
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
29
29
  from pygeodesy.named import _name__, _NamedDict, _NamedTuple, nameof, _xnamed
30
30
  from pygeodesy.namedTuples import Bounds2Tuple, Bounds4Tuple, LatLon2Tuple, \
@@ -38,7 +38,7 @@ from pygeodesy.units import Degrees_, Int, Lat_, Lon_, Meter, Precision_, Str
38
38
  from math import fabs, ldexp, log10, radians
39
39
 
40
40
  __all__ = _ALL_LAZY.geohash
41
- __version__ = '24.08.02'
41
+ __version__ = '24.08.05'
42
42
 
43
43
  _formy = _MODS.into(formy=__name__)
44
44
  _MASK5 = 16, 8, 4, 2, 1 # PYCHOK used!
@@ -118,8 +118,8 @@ def _2res(res, **prec):
118
118
  '''(INTERNAL) Get the C{res}olution for a C{prec}ision.
119
119
  '''
120
120
  p = max(min(Int(Error=GeohashError, **prec), _MaxPrec), 0) * 5
121
- p = (p - p // 2) if res > _180_0 else (p // 2)
122
- return ldexp(res, -p) if p else res
121
+ x = (p - p // 2) if res > _180_0 else (p // 2)
122
+ return ldexp(res, -x) if x else res # ldexp == res / float(1 << x)
123
123
 
124
124
 
125
125
  class _GH(object):
@@ -231,7 +231,7 @@ class _GH(object):
231
231
  '''Decode C{geohash} into 4-tuple C{(s, w, n, e)}.
232
232
  '''
233
233
  nc = len(geohash) if isstr(geohash) else 0
234
- if not (0 < nc <= _MaxPrec):
234
+ if not (0 < nc <= _MaxPrec): # or geohash.startswith(_INV_)
235
235
  raise GeohashError(geohash=geohash, len=nc)
236
236
  s, w, n, e = self.SWNE4
237
237
  D, d, _mid = self.DecodeB32, True, _2mid
@@ -507,6 +507,13 @@ class Geohash(Str):
507
507
  '''
508
508
  return len(self)
509
509
 
510
+ @Property_RO
511
+ def resolution2(self):
512
+ '''Get the I{lon-} and I{latitudinal} resolution of this cell
513
+ in a L{Resolutions2Tuple}C{(res1, res2)}, both in C{degrees}.
514
+ '''
515
+ return resolution2(self.precision, self.precision)
516
+
510
517
  @deprecated_property_RO
511
518
  def sizes(self):
512
519
  '''DEPRECATED on 2024.07.28, use property C{Geohash.sizes3}.'''
@@ -515,11 +522,11 @@ class Geohash(Str):
515
522
 
516
523
  @Property_RO
517
524
  def sizes3(self):
518
- '''Get the lat-, longitudinal and radial size of this cell as
519
- a L{Sizes3Tuple}C{(height, width, radius)}, all C{meter}.
525
+ '''Get the lat-, longitudinal and radial size of this cell in
526
+ a L{Sizes3Tuple}C{(height, width, radius)}, all in C{meter}.
520
527
  '''
521
528
  z = _GH.Sizes
522
- n = min(len(z) - 1, max(self.precision, 1))
529
+ n = min(max(self.precision, 1), len(z) - 1)
523
530
  return Sizes3Tuple(z[n], name=self.name)
524
531
 
525
532
  def toLatLon(self, LatLon=None, **LatLon_kwds):
@@ -650,7 +657,7 @@ class Geohashed(object):
650
657
  def _ab2round(self, *ll):
651
658
  '''(INTERNAL) Make encoded keys C{a, b}.
652
659
  '''
653
- return map(round, ll, self._nn)
660
+ return map(round, ll, self._nn) # strict=True
654
661
 
655
662
  def clear(self):
656
663
  '''Clear the C{en-} and C{decoded} cache.
@@ -1007,8 +1014,8 @@ def resolution2(prec1, prec2=None):
1007
1014
  (C{int} 1..12).
1008
1015
 
1009
1016
  @return: L{Resolutions2Tuple}C{(res1, res2)} with the
1010
- (geographic) resolutions C{degrees}, where C{res2
1011
- B{is} res1} if no B{C{prec2}} is given.
1017
+ (geographic) resolutions in C{degrees}, where
1018
+ C{res2 B{is} res1} if no B{C{prec2}} is given.
1012
1019
 
1013
1020
  @raise GeohashError: Invalid B{C{prec1}} or B{C{prec2}}.
1014
1021