Skip to main content
`Ctrl`+`K`

# ObsCoords

This Module contains the classes to manage point coordinates:

> - `GeoCoords` : For representation og geographic coordinates (lon, lat, alti)

> - `ENUCoords` : For local projection (East, North, Up)

> - `ECEFCoords` : For Earth-Centered-Earth-Fixed coordinates (X, Y, Z)

tracklib.core.ObsCoords.Re: float = 6378137.0

  Earth semi-major axis

tracklib.core.ObsCoords.Be: float = 6356752.314

  Earth semi-minor axis

tracklib.core.ObsCoords.Fe: float = 0.0033528106647474805

  Earth flattening

tracklib.core.ObsCoords.Ee: float = 0.0818191910428

  Earth eccentricity

class tracklib.core.ObsCoords.GeoCoords(lon, lat, hgt=0.0)

  Class to represent geographics coordinates

  __init__(lon, lat, hgt=0.0)

    Constructor of `GeoCoords` class

    Parameters

      - lon (`float`) – longitude in decimal degrees

      - lat (`float`) – latitude in decimal degrees

      - hgt (`float`) – height in meters above geoid or ellipsoid, defaults to 0

  __str__()

    Transform the object in string

    Return type

      `str`

    Returns

      String representation of coordinates

  copy()

    TODO

    Return type

      `GeoCoords`

  toECEFCoords()

    Convert geodetic coordinates to absolute ECEF

    Return type

      `ECEFCoords`

    Returns

      absolute ECEF coordinates

  toENUCoords(base)

    Convert geodetic coordinates to local ENU coords

    Parameters

      base (`Union`[`ECEFCoords`, `GeoCoords`]) – Base coordinates for conversion

    Return type

      `ENUCoords`

    Returns

      Converted coordinates

  toGeoCoords()

    Artificial function to ensure point is GeoCoords

    Return type

      `GeoCoords`

    Returns

      Copy of current object

  distanceTo(point)

    Distance between two geodetic coordinates

    Parameters

      point (`GeoCoords`) – Geographic coordinate

    Return type

      `float`

    Returns

      Distance

  distance2DTo(point)

    2D Distance between two geodetic coordinates

    Parameters

      point (`GeoCoords`) – Geographic coordinate

    Return type

      `float`

    Returns

      2D Distance

  elevationTo(point)

    Elevation between two geodetic coordinates

    Parameters

      point (`GeoCoords`) – Geographic coordinate

    Return type

      `float`

    Returns

      Elevation (in rad)

  azimuthTo(point)

    Azimut between two geodetic coordinates

    Parameters

      point (`GeoCoords`) – Geographic coordinate

    Return type

      `float`

    Returns

      Azimut (in rad)

  toProjCoords(srid_number)

    Special function to convert to specific ENU srid

    Parameters

      srid_number (`int`) – A SRID number describing projection coords (e.g. 2154 for Lambert 93)

    Return type

      `ENUCoords`

    Returns

      an ENUCoords object

  getX()

    Return the X coordinate

    Return type

      `float`

  getY()

    Return the Y coordinate

    Return type

      `float`

  getZ()

    Return the Z coordinate

    Return type

      `float`

  setX(X)

    Set the X coordinate

    Parameters

      X (`float`) – X coordinate

  setY(Y)

    Set the Y coordinate

    Parameters

      Y (`float`) – Y coordinate

  setZ(Z)

    Set the Z coordinate

    Parameters

      Z (`float`) – Z coordinate

  plot(sym='ro')

    TODO

class tracklib.core.ObsCoords.ENUCoords(E, N, U=0)

  Class for representation of local projection (East, North, Up)

  __init__(E, N, U=0)

    Constructor of class:ENUCoords class

    Parameters

      - E (`float`) – East coordinate (in meters)

      - N (`float`) – North coordinate (in meters)

      - U (`float`) – Elevation (in meter), defaults to 0

  __str__()

    Transform the object in string

    Returns

      String representation of coordinates

  copy()

    Copy the current object

    Return type

      `ENUCoords`

    Returns

      A copy of current object

  toECEFCoords(base)

    Convert local planimetric to absolute geocentric

    Parameters

      base (`Union`[`ECEFCoords`, `GeoCoords`]) – Base coordinates

    Return type

      `ECEFCoords`

    Returns

      Transformet coordinates

  toGeoCoords(base)

    Convert local ENU coordinates to geo coords

    Parameters

      base (`Union`[`ECEFCoords`, `GeoCoords`]) – Base coordinates

    Return type

      `GeoCoords`

    Returns

      Transformed coordinates

  toENUCoords(base1, base2)

    Convert local ENU coordinates relative to base1 to local ENU coordinates relative to base2.

    Parameters

      - base1 (`Union`[`ECEFCoords`, `GeoCoords`]) – Base 1 coordinates

      - base2 (`Union`[`ECEFCoords`, `GeoCoords`]) – Base 2 coordinates

    Return type

      `ENUCoords`

    Returns

      Transformed coordinates

  norm2D()

    Planimetric euclidian norm of point

    Return type

      `float`

    Returns

      Euclidian norm

  norm()

    R^3 space euclidian norm of point

    Return type

      `float`

    Returns

      R^3 space euclidian norm of point

  dot(point)

    Dot product between two vectors

    Parameters

      point – [description]

    Returns

      [description]

  elevationTo(point)

    Elevation between two ENU coordinates

    Parameters

      point (`ENUCoords`) – A ENUCoordinate

    Return type

      `float`

    Returns

      Elevation (in rad)

  azimuthTo(point)

    Azimut between two ENU coordinates

    Parameters

      point (`ENUCoords`) – A ENUCoordinate

    Return type

      `float`

    Returns

      Azimut (in rad)

  distance2DTo(point)

    Distance 2D between two ENU coordinates

    Parameters

      point (`ENUCoords`) – A ENU coordinate

    Return type

      `float`

    Returns

      2D distance

  distanceTo(point)

    Distance 3D between two ENU coordinates

    Parameters

      point (`ENUCoords`) – A ENU coordinate

    Return type

      `float`

    Returns

      2D distance

  rotate(theta)

    Rotation (2D) of point

    Parameters

      theta (`float`) – Angle of rotation (in rad)

  scale(h)

    Homotehtic transformation (2D) of point

    Parameters

      h (`float`) – factor

  translate(tx, ty, tz=0)

    Translation (3D) of point

    Parameters

      - tx (`float`) – X translation

      - ty (`float`) – Y translation

      - tz (`float`) – Z translation, defaults to 0

  getX()

    Return the X coordinate

    Return type

      `float`

  getY()

    Return the Y coordinate

    Return type

      `float`

  getZ()

    Return the Z coordinate

    Return type

      `float`

  setX(X)

    Set the X coordinate

    Parameters

      X (`float`) – X coordinate

  setY(Y)

    Set the Y coordinate

    Parameters

      Y (`float`) – Y coordinate

  setZ(Z)

    Set the Z coordinate

    Parameters

      Z (`float`) – Z coordinate

  plot(sym='ro')

    TODO

class tracklib.core.ObsCoords.ECEFCoords(X, Y, Z)

  Class to represent Earth-Centered-Earth-Fixed coordinates

  __init__(X, Y, Z)

    Constructor of `ECEFCoords` class

    Parameters

      - X (`float`) – X corrdinate (meters)

      - Y (`float`) – Y corrdinate (meters)

      - Z (`float`) – Z corrdinate (meters)

  __str__()

    Transform the object in string

    Return type

      `str`

    Returns

      String representation of coordinates

  copy()

    Copy the current object

    Return type

      `ECEFCoords`

    Returns

      A copy of current object

  toGeoCoords()

    Convert absolute geocentric coords to geodetic longitude, latitude and height

    Return type

      `GeoCoords`

    Returns

      GeoCoords representation of current coordinates

  toENUCoords(base)

    Convert local coordinates to absolute geocentric

    Parameters

      base (`Union`[`ECEFCoords`, `GeoCoords`]) – Base coordinates

    Return type

      `ENUCoords`

    Returns

      Transformed coordinates

  toECEFCoords()

    Artificial function to ensure point is ECEFCoords

    Return type

      `ECEFCoords`

    Returns

      ECEFCoords

  elevationTo(point)

    Elevation between two ECEF coordinates

    Parameters

      point (`ECEFCoords`) – Coordinate 2

    Return type

      `float`

    Returns

      Elevation (rad)

  azimuthTo(point)

    Azimut between two ECEF coordinates

    Parameters

      point (`ECEFCoords`) – Coordinate 2

    Return type

      `float`

    Returns

      Azimuth (rad)

  dot(point)

    Dot product between two vectors

  norm()

    R^3 space euclidian norm of point

    Return type

      `float`

    Returns

      R^3 space euclidian norm

  scalar(factor)

    Scalar multiplication of a vector

    Parameters

      factor (`float`) – Multiplication factor

  distanceTo(point)

    Distance between two ECEF coordinates

    Parameters

      point (`ECEFCoords`) – Corrdinate 2

    Return type

      `float`

    Returns

      Distance (meters)

  getX()

    Return the X coordinate

    Return type

      `float`

  getY()

    Return the X coordinate

    Return type

      `float`

  getZ()

    Return the X coordinate

    Return type

      `float`

  setX(X)

    Set the X coordinate

    Parameters

      X (`float`) – X coordinate

  setY(Y)

    Set the Y coordinate

    Parameters

      Y (`float`) – Y coordinate

  setZ(Z)

    Set the Z coordinate

    Parameters

      Z (`float`) – Z coordinate

tracklib.core.ObsCoords._proj(coords, srid)

  TODO

tracklib.core.ObsCoords._unproj(coords, srid)

  TODO

tracklib.core.ObsCoords.__projFromLambert93(coords)

  TODO

  Return type

    `GeoCoords`

tracklib.core.ObsCoords._projToLambert93(coords)

  TODO

  Return type

    `ENUCoords`

tracklib.core.ObsCoords._projFromUTM(coords, zone, northern=True)

  TODO