Terrestrial Domain

Specification

The Terrestrial domain (tracktable::domain::terrestrial) concerns points on the surface of the Earth. These points are located using longitude and latitude. In Tracktable, longitude and latitude are always measured in degrees and longitude always comes first. We prefer to let longitude range from -180 to 180 but the underlying math doesn’t care.

Units

Position in the terrestrial domain is measured in degrees of longitude and latitude. Longitude is always coordinate 0 and latitude is always coordinate 1. Points are presumed to lie on the surface of the Earth. If you want to include altitude, use the user-defined properties.

Distances are measured in kilometers. Speeds are measured in kilometers per hour.

Module Contents

class TerrestrialPoint : public tracktable::PointLonLat

2D point on a sphere

This class represents a point on a sphere. Its coordinates are measured in degrees of longitude and latitude.

Distances between TerrestrialPoints are measured in kilometers. Speeds between two TerrestrialTrajectoryPoints will be measured in kilometers per hour.

Subclassed by tracktable::TrajectoryPoint< TerrestrialPoint >

Public Types

using Superclass = PointLonLat

Public Functions

TerrestrialPoint() = default

Create an uninitialized point.

TerrestrialPoint(TerrestrialPoint const &other) = default

Copy constructor: make this point like another

Parameters:

other[in] Const point to make a copy of

TerrestrialPoint(TerrestrialPoint &&other) = default

Copy constructor: make this point like another

Parameters:

other[in] Const point to make a copy of

inline TerrestrialPoint(Superclass const &other)

Copy constructor: use PointLonLat instances as if they were TerrestrialPoint instances

Parameters:

other[in] Const point to make a copy of

~TerrestrialPoint() override = default

Empty destructor - nothing to do here.

inline TerrestrialPoint &operator=(TerrestrialPoint const &other)

Explicitly delegate assignment to prevent compiler hijinks.

TerrestrialPoint &operator=(TerrestrialPoint &&other) = default
inline TerrestrialPoint(double _longitude, double _latitude)

Convenience constructor.

Parameters:
  • _longitude[in] Longitude in degrees

  • _latitude[in] Latitude in degrees

template<class Archive>
inline void serialize(Archive &ar, const unsigned int)

Serialize the points to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive

Public Static Functions

static inline CartesianPoint3D ECEF_from_km(const coord_type _longitude, const coord_type _latitude, const double _altitude)

Returns ECEF values for lon, lat, and altitude. Uses a km convention.

Note

this expects an altitude in km (not ft or m).

Parameters:
  • _longitude[in] Longitude in degrees

  • _latitude[in] Latitude in degrees

  • _altitude[in] Altitude in km

Returns:

3D Earth Centered, Earth Fixed point in km

Friends

friend class boost::serialization::access
class TerrestrialTrajectoryPoint : public tracktable::TrajectoryPoint<TerrestrialPoint>

Earth Centered Earth Fixed

This group of functions is useful for converting longitude and latitude to a cartesian point. A static method is provided to convert any arbitrary point. ECEF_from_feet will be the most common use case. Multiple functions will throw an exception if altitude is not present. To bypass exception throws, use ECEF(ratio,altString) with the appropriate ratio to convert to km and the name of the property you are expecting to find altitude in.

See also

TerrestrialPoint::ECEF

inline CartesianPoint3D ECEF(const std::string &_altitudeString = "", const AltitudeUnits _unit = AltitudeUnits::KILOMETERS) const

Returns ECEF values for lon/lat points. Uses a km convention.

Note

this expects an altitude in km (not ft or m).

Parameters:
  • _altitudeString – The label of the property that contains altitude

  • _unit – The units the altitude contains

Returns:

3D Earth Centered, Earth Fixed point in km

inline CartesianPoint3D ECEF(const double ratio, const std::string &_altitudeString) const

Returns ECEF values for lon/lat points. Uses a km convention.

Note

this expects an altitude in km (not ft or m). Change ratio if the altitude is not km

Parameters:
  • ratio[in] The value to multiply altitude by to get km

  • _altitudeString[in] The label of the property that contains altitude

Throws:

PropertyDoesNotExist – if we can’t find altitude

Returns:

3D Earth Centered, Earth Fixed point in km

inline CartesianPoint3D ECEF_from_feet(const std::string &_altitudeString = "altitude") const

Returns ECEF values for lon/lat points. Uses a km convention.

Note

this expects an altitude in feet.

Parameters:

_altitudeString[in] The label of the property that contains altitude

Throws:

PropertyDoesNotExist – if we can’t find altitude

Returns:

3D Earth Centered, Earth Fixed point in km

inline CartesianPoint3D ECEF_from_meters(const std::string &_altitudeString = "altitude") const

Returns ECEF values for lon/lat points. Uses a km convention.

Note

this expects an altitude in meters.

Parameters:

_altitudeString[in] The label of the property that contains altitude

Throws:

PropertyDoesNotExist – if we can’t find altitude

Returns:

3D Earth Centered, Earth Fixed point in km

inline CartesianPoint3D ECEF_from_kilometers(const std::string &_altitudeString = "altitude") const

Returns ECEF values for lon/lat points. Uses a km convention.

Note

this expects an altitude in kilometers.

Parameters:

_altitudeString[in] The label of the property that contains altitude

Throws:

PropertyDoesNotExist – if we can’t find altitude

Returns:

3D Earth Centered, Earth Fixed point in km

Public Types

using Superclass = TrajectoryPoint<TerrestrialPoint>

Public Functions

TerrestrialTrajectoryPoint() = default

Create an uninitialized point.

TerrestrialTrajectoryPoint(TerrestrialTrajectoryPoint const &other) = default

Copy constructor: make this point like another

Parameters:

other[in] Const point to make a copy of

TerrestrialTrajectoryPoint(TerrestrialTrajectoryPoint &&other) = default

Copy constructor: make this point like another

Parameters:

other[in] Point to make a copy of

inline TerrestrialTrajectoryPoint(Superclass const &other)

Copy constructor: use PointLonLat instances as if they were TerrestrialTrajectoryPoint instances

Parameters:

other[in] Const point to make a copy of

~TerrestrialTrajectoryPoint() override = default

Empty destructor: nothing to do here.

inline TerrestrialTrajectoryPoint &operator=(TerrestrialTrajectoryPoint const &other)

Explicitly delegate assignment to prevent compiler hijinks.

TerrestrialTrajectoryPoint &operator=(TerrestrialTrajectoryPoint &&other) = default
inline TerrestrialTrajectoryPoint(double _longitude, double _latitude)

Convenience constructor.

Parameters:
  • _longitude[in] Longitude in degrees

  • _latitude[in] Latitude in degrees

Private Functions

template<class Archive>
inline void serialize(Archive &ar, const unsigned int)

Serialize the points to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive

Friends

friend class boost::serialization::access