Coverage for pygeodesy/namedTuples.py : 99%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
functions and class methods are now instances of some C{Named-Tuple} class, all sub-classes of C{_NamedTuple} defined in C{pygeodesy.named}.
@newfield example: Example, Examples '''
# update imported names under if __name__ == '__main__': _height_, _lam_, _lat_, _lon_, _n_, \ _northing_, _number_, _phi_, _points_, \ _precision_, _radius_, _x_, _y_, _z_ Lam, Lat, Lon, Meter, Northing, Number_, Phi, \ Precision_, Radius, Scalar
# __DUNDER gets mangled in class
'''2-Tuple C{(initial, final)} bearings, both in compass C{degrees360}. '''
'''2-Tuple C{(latlonSW, latlonNE)} with the bounds' lower-left and upper-right corner as C{LatLon} instance. '''
'''4-Tuple C{(latS, lonW, latN, lonE)} with the bounds' lower-left C{(LatS, LowW)} and upper-right C{(latN, lonE)} corner lat- and longitudes. '''
'''2-Tuple C{(destination, final)}, C{destination} in C{LatLon} and C{final} bearing in compass C{degrees360}. '''
'''3-Tuple C{(lat, lon, final)}, destination C{lat}, C{lon} in C{degrees90} respectively C{degrees180} and C{final} bearing in compass C{degrees360}. '''
'''2-Tuple C{(distance, initial)}, C{distance} in C{meter} and C{initial} bearing in compass C{degrees360}. '''
'''3-Tuple C{(distance, initial, final)}, C{distance} in C{meter} and C{initial} and C{final} bearing, both in compass C{degrees360}. '''
'''4-Tuple C{(distance2, delta_lat, delta_lon, unroll_lon2)} with the distance in C{degrees squared}, the latitudinal C{delta_lat} = B{C{lat2}}-B{C{lat1}}, the wrapped, unrolled and adjusted longitudinal C{delta_lon} = B{C{lon2}}-B{C{lon1}} and C{unroll_lon2}, the unrolled or original B{C{lon2}}.
@note: Use Function L{degrees2m} to convert C{degrees squared} to C{meter} as M{degrees2m(sqrt(distance2), ...)} or M{degrees2m(hypot(delta_lat, delta_lon), ...)}. '''
'''2-Tuple C{(easting, northing)}, both in C{meter}, conventionally. '''
'''3-Tuple C{(easting, northing, height)}, all in C{meter}, conventionally. '''
'''2-Tuple C{(lat, lon)} in C{degrees90} and C{degrees180}. '''
'''Extend this L{LatLon2Tuple} to a L{LatLon3Tuple}.
@arg height: The height to add (C{scalar}).
@return: A L{LatLon3Tuple}C{(lat, lon, height)}.
@raise ValueError: Invalid B{C{height}}. '''
'''Extend this L{LatLon2Tuple} to a L{LatLon4Tuple}.
@arg height: The height to add (C{scalar}). @arg datum: The datum to add (C{Datum}).
@return: A L{LatLon4Tuple}C{(lat, lon, height, datum)}.
@raise TypeError: If B{C{datum}} not a C{Datum}.
@raise ValueError: Invalid B{C{height}}. '''
'''3-Tuple C{(lat, lon, height)} in C{degrees90}, C{degrees180} and C{meter}, conventionally. '''
'''Extend this L{LatLon3Tuple} to a L{LatLon4Tuple}.
@arg datum: The datum to add (C{Datum}).
@return: A L{LatLon4Tuple}C{(lat, lon, height, datum)}.
@raise TypeError: If B{C{datum}} not a C{Datum}. '''
'''4-Tuple C{(lat, lon, height, datum)} in C{degrees90}, C{degrees180}, C{meter} and L{Datum}. '''
'''(INTERNAL) Return a L{LatLon4Tuple} or an B{C{LatLon}} instance. ''' else:
'''3-Tuple C{(lat, lon, datum)} in C{degrees90}, C{degrees180} and L{Datum}. '''
'''3-Tuple C{(lat, lon, precision)} in C{degrees}, C{degrees} and C{int}. '''
'''Extend this L{LatLonPrec3Tuple} to a L{LatLonPrec5Tuple}.
@arg height: The height to add (C{float} or C{None}). @arg radius: The radius to add (C{float} or C{None}).
@return: A L{LatLonPrec5Tuple}C{(lat, lon, precision, height, radius)}. '''
'''5-Tuple C{(lat, lon, precision, height, radius)} in C{degrees}, C{degrees}, C{int} and C{height} or C{radius} in C{meter} (or C{None} if missing). '''
'''3-Tuple C{(closest, distance, angle)} of the C{closest} point on the polygon, either a C{LatLon} instance or a L{LatLon3Tuple}C{(lat, lon, height)} and the C{distance} and C{angle} to the C{closest} point are in C{meter} respectively compass C{degrees360}. '''
'''2-Tuple C{(phi, lam)} with latitude C{phi} in C{radians[PI_2]} and longitude C{lam} in C{radians[PI]}.
@note: Using C{phi/lambda} for lat-/longitude in C{radians} follows Chris Veness' U{convention <https://www.Movable-Type.co.UK/scripts/latlong.html>}. '''
'''Extend this L{PhiLam2Tuple} to a L{PhiLam3Tuple}.
@arg height: The height to add (C{scalar}).
@return: A L{PhiLam3Tuple}C{(phi, lam, height)}.
@raise ValueError: Invalid B{C{height}}. '''
'''Extend this L{PhiLam2Tuple} to a L{PhiLam4Tuple}.
@arg height: The height to add (C{scalar}). @arg datum: The datum to add (C{Datum}).
@return: A L{PhiLam4Tuple}C{(phi, lam, height, datum)}.
@raise TypeError: If B{C{datum}} not a C{Datum}.
@raise ValueError: Invalid B{C{height}}. ''' return self.to3Tuple(height).to4Tuple(datum)
'''3-Tuple C{(phi, lam, height)} with latitude C{phi} in C{radians[PI_2]}, longitude C{lam} in C{radians[PI]} and C{height} in C{meter}.
@note: Using C{phi/lambda} for lat-/longitude in C{radians} follows Chris Veness' U{convention <https://www.Movable-Type.co.UK/scripts/latlong.html>}. '''
'''Extend this L{PhiLam3Tuple} to a L{PhiLam4Tuple}.
@arg datum: The datum to add (C{Datum}).
@return: A L{PhiLam4Tuple}C{(phi, lam, height, datum)}.
@raise TypeError: If B{C{datum}} not a C{Datum}. '''
'''4-Tuple C{(phi, lam, height, datum)} with latitude C{phi} in C{radians[PI_2]}, longitude C{lam} in C{radians[PI]}, C{height} in C{meter} and L{Datum}.
@note: Using C{phi/lambda} for lat-/longitude in C{radians} follows Chris Veness' U{convention <https://www.Movable-Type.co.UK/scripts/latlong.html>}. '''
'''2-Tuple C{(number, points)} with the C{number} of points and -possible reduced- C{list} or C{tuple} of C{points}. '''
'''5-Tuple C{(min, minPoint, max, maxPoint, n)} with C{min} and C{max} in C{meter}, the corresponding trilaterated C{minPoint} and C{maxPoint} as C{LatLon} and the number C{n}. For area overlap, C{min} and C{max} are the smallest respectively largest overlap found. For perimeter intersection, C{min} and C{max} represent the closest respectively farthest intersection margin. Count C{n} is the total number of trilaterated overlaps or intersections found, C{0, 1, 2...6} with C{0} meaning concentric.
@see: The C{ellipsoidalKarney-}, C{ellipsoidalVincenty-} and C{sphericalTrigonometry.LatLon.trilaterate5} method for further details on corner cases, like concentric or single trilaterated results. '''
'''3-Tuple C{(x, y, z)} of (geocentric) components, all in C{meter} or C{units}. '''
'''Extend this L{Vector3Tuple} to a L{Vector4Tuple}.
@arg h: The height to add (C{scalar}).
@return: A L{Vector4Tuple}C{(x, y, z, h)}.
@raise ValueError: Invalid B{C{h}}. '''
'''4-Tuple C{(x, y, z, h)} of (geocentric) components, all in C{meter} or C{units}. '''
Destination2Tuple, Destination3Tuple, Distance2Tuple, Distance3Tuple, Distance4Tuple, EasNor2Tuple, EasNor3Tuple, LatLon2Tuple, LatLon3Tuple, LatLon4Tuple, LatLonDatum3Tuple, LatLonPrec3Tuple, LatLonPrec5Tuple, NearestOn3Tuple, PhiLam2Tuple, PhiLam3Tuple, PhiLam4Tuple, Points2Tuple, Trilaterate5Tuple, Vector3Tuple, Vector4Tuple)
# **) MIT License # # Copyright (C) 2016-2020 -- mrJean1 at Gmail -- All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE.
# % env PYGEODESY_FOR_DOCS=1 python -m pygeodesy.named # all 71 locals OK |