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)[source]#

Class to represent geographics coordinates

__init__(lon, lat, hgt=0.0)[source]#

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__()[source]#

Transform the object in string

Return type

str

Returns

String representation of coordinates

copy()[source]#

TODO

Return type

GeoCoords

toECEFCoords()[source]#

Convert geodetic coordinates to absolute ECEF

Return type

ECEFCoords

Returns

absolute ECEF coordinates

toENUCoords(base)[source]#

Convert geodetic coordinates to local ENU coords

Parameters

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

Return type

ENUCoords

Returns

Converted coordinates

toGeoCoords()[source]#

Artificial function to ensure point is GeoCoords

Return type

GeoCoords

Returns

Copy of current object

distanceTo(point)[source]#

Distance between two geodetic coordinates

Parameters

point (GeoCoords) – Geographic coordinate

Return type

float

Returns

Distance

distance2DTo(point)[source]#

2D Distance between two geodetic coordinates

Parameters

point (GeoCoords) – Geographic coordinate

Return type

float

Returns

2D Distance

elevationTo(point)[source]#

Elevation between two geodetic coordinates

Parameters

point (GeoCoords) – Geographic coordinate

Return type

float

Returns

Elevation (in rad)

azimuthTo(point)[source]#

Azimut between two geodetic coordinates

Parameters

point (GeoCoords) – Geographic coordinate

Return type

float

Returns

Azimut (in rad)

toProjCoords(srid_number)[source]#

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()[source]#

Return the X coordinate

Return type

float

getY()[source]#

Return the Y coordinate

Return type

float

getZ()[source]#

Return the Z coordinate

Return type

float

setX(X)[source]#

Set the X coordinate

Parameters

X (float) – X coordinate

setY(Y)[source]#

Set the Y coordinate

Parameters

Y (float) – Y coordinate

setZ(Z)[source]#

Set the Z coordinate

Parameters

Z (float) – Z coordinate

plot(sym='ro')[source]#

TODO

class tracklib.core.ObsCoords.ENUCoords(E, N, U=0)[source]#

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

__init__(E, N, U=0)[source]#

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__()[source]#

Transform the object in string

Returns

String representation of coordinates

copy()[source]#

Copy the current object

Return type

ENUCoords

Returns

A copy of current object

toECEFCoords(base)[source]#

Convert local planimetric to absolute geocentric

Parameters

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

Return type

ECEFCoords

Returns

Transformet coordinates

toGeoCoords(base)[source]#

Convert local ENU coordinates to geo coords

Parameters

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

Return type

GeoCoords

Returns

Transformed coordinates

toENUCoords(base1, base2)[source]#

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

Parameters
Return type

ENUCoords

Returns

Transformed coordinates

norm2D()[source]#

Planimetric euclidian norm of point

Return type

float

Returns

Euclidian norm

norm()[source]#

R^3 space euclidian norm of point

Return type

float

Returns

R^3 space euclidian norm of point

dot(point)[source]#

Dot product between two vectors

Parameters

point – [description]

Returns

[description]

elevationTo(point)[source]#

Elevation between two ENU coordinates

Parameters

point (ENUCoords) – A ENUCoordinate

Return type

float

Returns

Elevation (in rad)

azimuthTo(point)[source]#

Azimut between two ENU coordinates

Parameters

point (ENUCoords) – A ENUCoordinate

Return type

float

Returns

Azimut (in rad)

distance2DTo(point)[source]#

Distance 2D between two ENU coordinates

Parameters

point (ENUCoords) – A ENU coordinate

Return type

float

Returns

2D distance

distanceTo(point)[source]#

Distance 3D between two ENU coordinates

Parameters

point (ENUCoords) – A ENU coordinate

Return type

float

Returns

2D distance

rotate(theta)[source]#

Rotation (2D) of point

Parameters

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

scale(h)[source]#

Homotehtic transformation (2D) of point

Parameters

h (float) – factor

translate(tx, ty, tz=0)[source]#

Translation (3D) of point

Parameters
  • tx (float) – X translation

  • ty (float) – Y translation

  • tz (float) – Z translation, defaults to 0

getX()[source]#

Return the X coordinate

Return type

float

getY()[source]#

Return the Y coordinate

Return type

float

getZ()[source]#

Return the Z coordinate

Return type

float

setX(X)[source]#

Set the X coordinate

Parameters

X (float) – X coordinate

setY(Y)[source]#

Set the Y coordinate

Parameters

Y (float) – Y coordinate

setZ(Z)[source]#

Set the Z coordinate

Parameters

Z (float) – Z coordinate

plot(sym='ro')[source]#

TODO

class tracklib.core.ObsCoords.ECEFCoords(X, Y, Z)[source]#

Class to represent Earth-Centered-Earth-Fixed coordinates

__init__(X, Y, Z)[source]#

Constructor of ECEFCoords class

Parameters
  • X (float) – X corrdinate (meters)

  • Y (float) – Y corrdinate (meters)

  • Z (float) – Z corrdinate (meters)

__str__()[source]#

Transform the object in string

Return type

str

Returns

String representation of coordinates

copy()[source]#

Copy the current object

Return type

ECEFCoords

Returns

A copy of current object

toGeoCoords()[source]#

Convert absolute geocentric coords to geodetic longitude, latitude and height

Return type

GeoCoords

Returns

GeoCoords representation of current coordinates

toENUCoords(base)[source]#

Convert local coordinates to absolute geocentric

Parameters

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

Return type

ENUCoords

Returns

Transformed coordinates

toECEFCoords()[source]#

Artificial function to ensure point is ECEFCoords

Return type

ECEFCoords

Returns

ECEFCoords

elevationTo(point)[source]#

Elevation between two ECEF coordinates

Parameters

point (ECEFCoords) – Coordinate 2

Return type

float

Returns

Elevation (rad)

azimuthTo(point)[source]#

Azimut between two ECEF coordinates

Parameters

point (ECEFCoords) – Coordinate 2

Return type

float

Returns

Azimuth (rad)

dot(point)[source]#

Dot product between two vectors

norm()[source]#

R^3 space euclidian norm of point

Return type

float

Returns

R^3 space euclidian norm

scalar(factor)[source]#

Scalar multiplication of a vector

Parameters

factor (float) – Multiplication factor

distanceTo(point)[source]#

Distance between two ECEF coordinates

Parameters

point (ECEFCoords) – Corrdinate 2

Return type

float

Returns

Distance (meters)

getX()[source]#

Return the X coordinate

Return type

float

getY()[source]#

Return the X coordinate

Return type

float

getZ()[source]#

Return the X coordinate

Return type

float

setX(X)[source]#

Set the X coordinate

Parameters

X (float) – X coordinate

setY(Y)[source]#

Set the Y coordinate

Parameters

Y (float) – Y coordinate

setZ(Z)[source]#

Set the Z coordinate

Parameters

Z (float) – Z coordinate

tracklib.core.ObsCoords._proj(coords, srid)[source]#

TODO

tracklib.core.ObsCoords._unproj(coords, srid)[source]#

TODO

tracklib.core.ObsCoords.__projFromLambert93(coords)[source]#

TODO

Return type

GeoCoords

tracklib.core.ObsCoords._projToLambert93(coords)[source]#

TODO

Return type

ENUCoords

tracklib.core.ObsCoords._projFromUTM(coords, zone, northern=True)[source]#

TODO