Package pygeodesy :: Module ellipsoidalBase :: Class LatLonEllipsoidalBase |
[frames] | no frames]

# Class LatLonEllipsoidalBase

       object --+
                |
     named._Named --+
                    |
     named._NamedBase --+
                        |
    latlonBase.LatLonBase --+
                            |
                           LatLonEllipsoidalBase

Known Subclasses:
  - ellipsoidalExact.LatLon
  - , ellipsoidalGeodSolve.LatLon
  - , ellipsoidalKarney.LatLon
  - , ellipsoidalNvector.LatLon
  - , ellipsoidalVincenty.LatLon

(INTERNAL) Base class for ellipsoidal `LatLon`s.

Instance Methods
__init__(self, lat, lon, height=0, datum=None, reframe=None, epoch=None, name='') Create an ellipsoidal `LatLon` point frome the given lat-, longitude and height on the given datum and with the given reference frame and epoch. |
antipode(self, height=None) Return the antipode, the point diametrically opposite to this point. |
convertDatum(self, datum2) DEPRECATED, use method toDatum. |
convertRefFrame(self, reframe2) DEPRECATED, use method toRefFrame. |
distanceTo2(self, other) Approximate the distance and (initial) bearing between this and an other (ellipsoidal) point based on the radii of curvature. |
elevation2(self, adjust=True, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) Return elevation of this point for its or the given datum. |
ellipsoid(self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`) Return the ellipsoid of this point's datum or the given datum. |
ellipsoids(self, other) Check the type and ellipsoid of this and an other point's datum. |
geoidHeight2(self, adjust=False, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) Return geoid height of this point for its or the given datum. |
intersections2(self, radius1, other, radius2, height=None, wrap=True, equidistant=None, tol=0.001) Compute the intersection points of two circles each defined by a center point and a radius. |
nearestOn(self, point1, point2, within=True, height=None, wrap=True, equidistant=None, tol=0.001) Locate the closest point between two other points. |
parse(self, strllh, height=0, datum=None, sep=',', name='') Parse a string representing a similar, ellipsoidal `LatLon` point, consisting of `"lat, lon[, height]"`. |
toDatum(self, datum2) Convert this point to an other datum. |
toEtm(self) Convert this `LatLon` point to an ETM coordinate. |
toLcc(self) Convert this `LatLon` point to a Lambert location. |
toOsgr(self) Convert this `LatLon` point to an OSGR coordinate. |
toRefFrame(self, reframe2) Convert this point to an other reference frame. |
toUps(self, pole=`'``N``'`, falsed=True) Convert this `LatLon` point to a UPS coordinate. |
toUtm(self) Convert this `LatLon` point to a UTM coordinate. |
toUtmUps(self, pole='') Convert this `LatLon` point to a UTM or UPS coordinate. |
toWm(self) Convert this `LatLon` point to a WM coordinate. |
to3xyz(self) DEPRECATED, use method `toEcef`. |
trilaterate5(self, distance1, point2, distance2, point3, distance3, area=True, eps=1.0, wrap=False) Trilaterate three points by area overlap or perimeter intersection of three intersecting circles. |
Inherited from `latlonBase.LatLonBase`: `PointsIter`, `__eq__`, `__ne__`, `__str__`, `_distanceTo_`, `bounds`, `boundsOf`, `chordTo`, `compassAngle`, `compassAngleTo`, `cosineAndoyerLambertTo`, `cosineForsytheAndoyerLambertTo`, `cosineLawTo`, `destinationXyz`, `equals`, `equals3`, `equirectangularTo`, `euclideanTo`, `flatLocalTo`, `flatPolarTo`, `haversineTo`, `heightStr`, `hubenyTo`, `isantipode`, `isantipodeTo`, `isequalTo`, `isequalTo3`, `latlon2`, `latlon2round`, `latlon_`, `philam2`, `points`, `points2`, `thomasTo`, `to2ab`, `to3llh`, `toCartesian`, `toEcef`, `toLocal`, `toLtp`, `toNvector`, `toStr`, `toVector`, `toVector3d`, `vincentysTo` Inherited from `named._NamedBase`: `__repr__`, `others`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| convergence Get this point's UTM or UPS meridian convergence (`degrees`) or `None` if not available or not converted from Utm or Ups.
| datum Property to get and set this points's datum (Datum).
| epoch Property to get and set this point's observed or `reframe` epoch (`float`).
| iteration Get the most recent `intersections2` or `nearestOn` iteration number (`int`) or `None` if not available/applicable.
| reframe Property to get and set this point's reference frame (RefFrame).
| scale Get this point's UTM grid or UPS point scale factor (`float`) or `None` if not converted from Utm or Ups.
Inherited from `latlonBase.LatLonBase`: `Ecef`, `height`, `isEllipsoidal`, `isSpherical`, `lam`, `lat`, `latlon`, `latlonheight`, `lon`, `phi`, `philam`, `philamheight`, `xyz`, `xyzh` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, lat, lon, height=0, datum=None, reframe=None, epoch=None, name='') (Constructor) |
Create an ellipsoidal `LatLon` point frome the given lat-, longitude and height on the given datum and with the given reference frame and epoch. Arguments: `lat` - Latitude (`degrees` or DMS `[N|S]`). `lon` - Longitude (`degrees` or DMS `str[E|W]`). `height` - Optional elevation (`meter`, the same units as the datum's half-axes). `datum` - Optional, ellipsoidal datum to use (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `reframe` - Optional reference frame (RefFrame). `epoch` - Optional epoch to observe for `reframe` (`scalar`), a non-zero, fractional calendar year; silently ignored if `reframe=None`. `name` - Optional name (string). Returns: New instance (`LatLon`). Raises: `RangeError` - Value of `lat` or `lon` outside the valid range and `rangerrors` set to `True`. `TypeError` - `datum` is not a datum, `reframe` is not a RefFrame or `epoch` is not `scalar` non-zero. `UnitError` - Invalid `lat`, `lon` or `height`. Overrides: object.__init__ Example:
    >>> p = LatLon(51.4778, -0.0016)  # height=0, datum=Datums.WGS84

### antipode (self, height=None) |
Return the antipode, the point diametrically opposite to this point. Arguments: `height` - Optional height of the antipode, height of this point otherwise (`meter`). Returns: The antipodal point (`LatLon`). Overrides: latlonBase.LatLonBase.antipode

### convertDatum (self, datum2) |
DEPRECATED, use method toDatum. Decorators: `@deprecated_method`

### convertRefFrame (self, reframe2) |
DEPRECATED, use method toRefFrame. Decorators: `@deprecated_method`

### distanceTo2 (self, other) |
Approximate the distance and (initial) bearing between this and an other (ellipsoidal) point based on the radii of curvature. Suitable only for short distances up to a few hundred Km or Miles and only between points not near-polar. Arguments: `other` - The other point (`LatLon`). Returns: An Distance2Tuple`(distance, initial)`. Raises: `TypeError` - The `other` point is not `LatLon`. `ValueError` - Incompatible datum ellipsoids. See Also: Method Ellipsoid.distance2 and Local, flat earth approximation aka Hubeny formula.

### elevation2 (self, adjust=True, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) |
Return elevation of this point for its or the given datum. Arguments: `adjust` - Adjust the elevation for a `datum` other than `NAD83` (`bool`). `datum` - Optional datum (Datum). `timeout` - Optional query timeout (`seconds`). Returns: An Elevation2Tuple`(elevation, data_source)` or `(None, error)` in case of errors. Notes: The adjustment applied is the difference in geocentric earth radius between the `datum` and `NAV83` upon which the elevations.elevation2 is based. NED elevation is only available for locations within the Conterminous US (CONUS). See Also: Function elevations.elevation2 and method Ellipsoid.Rgeocentric for further details and possible `error`s.

### ellipsoid (self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`) |
Return the ellipsoid of this point's datum or the given datum. Arguments: `datum` - Default datum (Datum). Returns: The ellipsoid (Ellipsoid or Ellipsoid2).

### ellipsoids (self, other) |
Check the type and ellipsoid of this and an other point's datum. Arguments: `other` - The other point (`LatLon`). Returns: This point's datum ellipsoid (Ellipsoid or Ellipsoid2). Raises: `TypeError` - The `other` point is not `LatLon`. `ValueError` - Incompatible datum ellipsoids.

### geoidHeight2 (self, adjust=False, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) |
Return geoid height of this point for its or the given datum. Arguments: `adjust` - Adjust the geoid height for a `datum` other than `NAD83/NADV88` (`bool`). `datum` - Optional datum (Datum). `timeout` - Optional query timeout (`seconds`). Returns: A GeoidHeight2Tuple`(height, model_name)` or `(None, error)` in case of errors. Notes: The adjustment applied is the difference in geocentric earth radius between the `datum` and `NAV83/NADV88` upon which the elevations.geoidHeight2 is based. The geoid height is only available for locations within the Conterminous US (CONUS). See Also: Function elevations.geoidHeight2 and method Ellipsoid.Rgeocentric for further details and possible `error`s.

### intersections2 (self, radius1, other, radius2, height=None, wrap=True, equidistant=None, tol=0.001) |
Compute the intersection points of two circles each defined by a center point and a radius. Arguments: `radius1` - Radius of the this circle (`meter`, conventionally). `other` - Center of the other circle (`LatLon`). `radius2` - Radius of the other circle (`meter`, same units as `radius1`). `height` - Optional height for the intersection points, overriding the "radical height" at the "radical line" between both centers (`meter`) or `None`. `wrap` - Wrap and unroll longitudes (`bool`). `equidistant` - An azimuthal equidistant projection class (Equidistant or EquidistantKarney), function equidistant will be invoked if left unspecified. `tol` - Convergence tolerance (`meter`, same units as `radius1` and `radius2`). Returns: 2-Tuple of the intersection points, each a `LatLon` instance. For abutting circles, both intersection points are the same instance. Raises: `ImportError` - Package geographiclib not installed or not found. `IntersectionError` - Concentric, antipodal, invalid or non-intersecting circles or no convergence for `tol`. `TypeError` - Invalid `other` or `equidistant`. `UnitError` - Invalid `radius1`, `radius2` or `height`. See Also: The ellipsoidal case, Karney's paper, pp 20-21, section 14. MARITIME BOUNDARIES, circle-circle and sphere-sphere intersections.

### nearestOn (self, point1, point2, within=True, height=None, wrap=True, equidistant=None, tol=0.001) |
Locate the closest point between two other points. Arguments: `point1` - Start point (`LatLon`). `point2` - End point (`LatLon`). `within` - If `True` return the closest point between `point1` and `point2`, otherwise the closest point elsewhere on the arc (`bool`). `height` - Optional height for the closest point (`meter`) or `None` to interpolate the height. `wrap` - Wrap and unroll longitudes (`bool`). `equidistant` - An azimuthal equidistant projection class (Equidistant or EquidistantKarney), function equidistant will be invoked if left unspecified. `tol` - Convergence tolerance (`meter`). Returns: Closest point (`LatLon`). Raises: `ImportError` - Package geographiclib not installed or not found. `TypeError` - Invalid `point1`, `point2` or `equidistant`.

### parse (self, strllh, height=0, datum=None, sep=',', name='') |
Parse a string representing a similar, ellipsoidal `LatLon` point, consisting of `"lat, lon[, height]"`. Arguments: `strllh` - Lat, lon and optional height (`str`), see function parse3llh. `height` - Optional, default height (`meter` or `None`). `datum` - Optional datum (Datum), overriding this datum without conversion. `sep` - Optional separator (`str`). `name` - Optional instance name (`str`), overriding this name. Returns: The similar point (ellipsoidal `LatLon`). Raises: `ParseError` - Invalid `strllh`.

### toDatum (self, datum2) |
Convert this point to an other datum. Arguments: `datum2` - Datum to convert to (Datum). Returns: The converted point (ellipsoidal `LatLon`). Raises: `TypeError` - The `datum2` invalid. Example:
    >>> p = LatLon(51.4778, -0.0016)  # default Datums.WGS84
    >>> p.toDatum(Datums.OSGB36)  # 51.477284°N, 000.00002°E

### toEtm (self) |
Convert this `LatLon` point to an ETM coordinate. Returns: The ETM coordinate (Etm). See Also: Function toEtm8.

### toLcc (self) |
Convert this `LatLon` point to a Lambert location. Returns: The Lambert location (Lcc). See Also: Function toLcc in module lcc.

### toOsgr (self) |
Convert this `LatLon` point to an OSGR coordinate. Returns: The OSGR coordinate (Osgr). See Also: Function toOsgr in module osgr.

### toRefFrame (self, reframe2) |
Convert this point to an other reference frame. Arguments: `reframe2` - Reference frame to convert to (RefFrame). Returns: The converted point (ellipsoidal `LatLon`) or this point if conversion is `nil`. Raises: `TRFError` - This `reframe` not defined or no conversion available from this `reframe` to `reframe2`. `TypeError` - The `reframe2` is not a RefFrame. Example:
    >>> p = LatLon(51.4778, -0.0016, reframe=RefFrames.ETRF2000)  # default Datums.WGS84
    >>> p.toRefFrame(RefFrames.ITRF2014)  # 51.477803°N, 000.001597°W, +0.01m

### toUps (self, pole=`'``N``'`, falsed=True) |
Convert this `LatLon` point to a UPS coordinate. Arguments: `pole` - Optional top/center of (stereographic) projection (`str`, 'N[orth]' or 'S[outh]'). `falsed` - False easting and northing (`bool`). Returns: The UPS coordinate (Ups). See Also: Function toUps8.

### toUtm (self) |
Convert this `LatLon` point to a UTM coordinate. Returns: The UTM coordinate (Utm). See Also: Function toUtm8.

### toUtmUps (self, pole='') |
Convert this `LatLon` point to a UTM or UPS coordinate. Arguments: `pole` - Optional top/center of UPS (stereographic) projection (`str`, 'N[orth]' or 'S[outh]'). Returns: The UTM or UPS coordinate (Utm or Ups). Raises: `TypeError` - Result in Utm or Ups. See Also: Function toUtmUps.

### toWm (self) |
Convert this `LatLon` point to a WM coordinate. Returns: The WM coordinate (Wm). See Also: Function toWm in module webmercator.

### to3xyz (self) |
DEPRECATED, use method `toEcef`. Returns: A Vector3Tuple`(x, y, z)`. Decorators: `@deprecated_method` Overrides: latlonBase.LatLonBase.to3xyz Note: Overloads `LatLonBase.to3xyz`

### trilaterate5 (self, distance1, point2, distance2, point3, distance3, area=True, eps=1.0, wrap=False) |
Trilaterate three points by area overlap or perimeter intersection of three intersecting circles. Arguments: `distance1` - Distance to this point (`meter`), same units as `eps`). `point2` - Second center point (`LatLon`). `distance2` - Distance to point2 (`meter`, same units as `eps`). `point3` - Third center point (`LatLon`). `distance3` - Distance to point3 (`meter`, same units as `eps`). `area` - If `True` compute the area overlap, otherwise the perimeter intersection of the circles (`bool`). `eps` - The required minimal overlap for `area=True` or the intersection margin for `area=False` (`meter`, conventionally). `wrap` - Wrap/unroll angular distances (`bool`). Returns: A Trilaterate5Tuple`(min, minPoint, max, maxPoint, n)` with `min` and `max` in `meter`, same units as `eps`, the corresponding trilaterated points `minPoint` and `maxPoint` as ellipsoidal `LatLon` and `n`, the number of trilatered points found for the given `eps`. If only a single trilaterated point is found, `min is max`, `minPoint is maxPoint` and `n = 1`. For `area=True`, `min` and `max` are the smallest respectively largest radial overlap found. For `area=False`, `min` and `max` represent the nearest respectively farthest intersection margin. If `area=True` and all 3 circles are concentric, `n=0` and `minPoint` and `maxPoint` are the `point#` with the smallest `distance#` `min` respectively `max` the largest `distance#`. Raises: `IntersectionError` - Trilateration failed for the given `eps`, insufficient overlap for `area=True` or no intersection or all (near-)concentric for `area=False`. `TypeError` - Invalid `point2` or `point3`. `ValueError` - Coincident `points` or invalid `distance1`, `distance2` or `distance3`. Note: Ellipsoidal trilateration invokes methods `LatLon.intersections2` and `LatLon.nearestOn`. Install Karney's Python package geographiclib to obtain the most accurate results for both `ellipsoidalVincenty.LatLon` and `ellipsoidalKarney.LatLon` points.

Property Details

### convergence Get this point's UTM or UPS meridian convergence (`degrees`) or `None` if not available or not converted from Utm or Ups. Get method: convergence(self) - Get this point's UTM or UPS meridian convergence (`degrees`) or `None` if not available or not converted from Utm or Ups. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### datum Property to get and set this points's datum (Datum). Get method: datum(self) - Get this point's datum (Datum). Set method: datum(self, datum) - Set this point's datum without conversion.

### epoch Property to get and set this point's observed or `reframe` epoch (`float`). Get method: epoch(self) - Get this point's observed or `reframe` epoch (`float`) or `None`. Set method: epoch(self, epoch) - Set or clear this point's observed epoch.

### iteration Get the most recent `intersections2` or `nearestOn` iteration number (`int`) or `None` if not available/applicable. Get method: iteration(self) - Get the most recent `intersections2` or `nearestOn` iteration number (`int`) or `None` if not available/applicable. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### reframe Property to get and set this point's reference frame (RefFrame). Get method: reframe(self) - Get this point's reference frame (RefFrame) or `None`. Set method: reframe(self, reframe) - Set or clear this point's reference frame.

### scale Get this point's UTM grid or UPS point scale factor (`float`) or `None` if not converted from Utm or Ups. Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)