mrpt.topography

mrpt.topography — Geodetic coordinate conversion utilities.

Provides:
  • TCoords : Degrees/minutes/seconds coordinate type

  • TGeodeticCoords : (latitude, longitude, height) WGS84 coordinate

  • geodeticToGeocentric_WGS84() : WGS84 geodetic → ECEF geocentric (TPoint3D)

  • geocentricToGeodetic() : ECEF geocentric → WGS84 geodetic

  • geodeticToENU_WGS84() : WGS84 geodetic → local ENU coordinates

  • ENUToGeocentric() : ENU local → ECEF geocentric

  • ENUToGeodetic_WGS84() : ENU local → WGS84 geodetic

  • TEllipsoid, geodeticToGeocentric() : geodetic ↔ geocentric for any ellipsoid

  • geodeticToUTM(), UTMToGeodetic() : geodetic ↔ UTM

  • ENU_axes_from_WGS84() : ENU frame at a given point

Example:

import mrpt.topography as topo

origin = topo.TGeodeticCoords(37.0, -7.0, 10.0)  # lat, lon (deg), height (m)
point  = topo.TGeodeticCoords(37.001, -6.999, 10.0)
enu = topo.geodeticToENU_WGS84(point, origin)
print(f"ENU: ({enu.x:.2f}, {enu.y:.2f}) m")

Package Contents

class mrpt.topography.TCoords

C++ API: struct mrpt::topography::TCoords

TCoords(decimal_deg: float) TCoords(deg: int, min: int, sec: float)

decimal_value: float
getDecimalValue() → float
getDegMinSec() → tuple

Returns (degrees, minutes, seconds) tuple

setFromDecimal(arg0: float) → None
class mrpt.topography.TEllipsoid

C++ API: struct mrpt::topography::TEllipsoid

TEllipsoid(sa: float, sb: float, name: str)

property sa: float

Largest semiaxis (meters)

property sb: float

Smallest semiaxis (meters)

name: str
static Ellipsoid_Airy_1830() → TEllipsoid
static Ellipsoid_Airy_Modificado_1965() → TEllipsoid
static Ellipsoid_Bessel_1841() → TEllipsoid
static Ellipsoid_Clarke_1866() → TEllipsoid
static Ellipsoid_Clarke_1880() → TEllipsoid
static Ellipsoid_Fischer_1960() → TEllipsoid
static Ellipsoid_Fischer_1968() → TEllipsoid
static Ellipsoid_GRS80() → TEllipsoid
static Ellipsoid_Hayford_1909() → TEllipsoid
static Ellipsoid_Helmert_1906() → TEllipsoid
static Ellipsoid_Hough_1960() → TEllipsoid
static Ellipsoid_Internacional_1909() → TEllipsoid
static Ellipsoid_Internacional_1924() → TEllipsoid
static Ellipsoid_Krasovsky_1940() → TEllipsoid
static Ellipsoid_Mercury_1960() → TEllipsoid
static Ellipsoid_Mercury_Modificado_1968() → TEllipsoid
static Ellipsoid_Nuevo_Internacional_1967() → TEllipsoid
static Ellipsoid_Sudamericano_1969() → TEllipsoid
static Ellipsoid_WGS66() → TEllipsoid
static Ellipsoid_WGS72() → TEllipsoid
static Ellipsoid_WGS84() → TEllipsoid
static Ellipsoid_Walbeck_1817() → TEllipsoid
class mrpt.topography.TGeodeticCoords

C++ API: struct mrpt::topography::TGeodeticCoords

TGeodeticCoords(lat_deg: float, lon_deg: float, height_m: float)

property height: float

Geodetic height in meters

property lat: TCoords

Latitude in degrees (TCoords)

property lon: TCoords

Longitude in degrees (TCoords)

mrpt.topography.ENUToGeocentric(enu: mrpt.math.TPoint3D, origin: TGeodeticCoords) → mrpt.math.TPoint3D

Convert ENU local coordinates to ECEF geocentric, given a WGS84 reference origin

mrpt.topography.ENUToGeodetic_WGS84(enu: mrpt.math.TPoint3D, origin: TGeodeticCoords) → TGeodeticCoords

Convert local ENU coordinates (meters) relative to origin to a WGS84 geodetic point. Exact inverse of geodeticToENU_WGS84()

mrpt.topography.ENU_axes_from_WGS84(coords: TGeodeticCoords, only_angles: bool = False) → mrpt.math.TPose3D

Returns the East-North-Up frame at the given point, as a TPose3D in ECEF coordinates

mrpt.topography.UTMToGeodetic(utm: mrpt.math.TPoint3D, zone: int, hemisphere: str | None = None, ellipsoid: TEllipsoid = ..., band: str | None = None) → TGeodeticCoords

Convert UTM coordinates (utm.z is the height) to geodetic coordinates. Give either the hemisphere (‘N’ or ‘S’) or the latitude band returned by geodeticToUTM() (band=…).

mrpt.topography.geocentricToGeodetic(geocentric: mrpt.math.TPoint3D, ellipsoid: TEllipsoid = ...) → TGeodeticCoords

Convert geocentric ECEF TPoint3D (x,y,z) to geodetic coordinates (default: WGS84)

mrpt.topography.geodeticToENU_WGS84(point: TGeodeticCoords, origin: TGeodeticCoords) → mrpt.math.TPoint3D

Convert WGS84 geodetic point to local ENU coordinates (meters) relative to origin

mrpt.topography.geodeticToGeocentric(geodetic: TGeodeticCoords, ellipsoid: TEllipsoid) → mrpt.math.TPoint3D

Convert geodetic (lat,lon,h) to geocentric (ECEF) TPoint3D for the given ellipsoid

mrpt.topography.geodeticToGeocentric_WGS84(geodetic: TGeodeticCoords) → mrpt.math.TPoint3D

Convert WGS84 geodetic (lat,lon,h) to geocentric (ECEF) TPoint3D (x,y,z) in meters

mrpt.topography.geodeticToUTM(geodetic: TGeodeticCoords, ellipsoid: TEllipsoid = ...) → tuple

Convert geodetic coordinates to UTM. Returns (utm: TPoint3D, zone: int, band: str); utm.z is the height