GlsMap Toolkit  1.9.0
disti::GeoCoord Class Reference

#include <gls_map_util.h>

Classes

class  EllipsoidParams
 

Public Member Functions

void SetGeodetic (const Vector &lonLatAlt, const EllipsoidParams &ellipsoid=GeoCoord::WGS84)
 
void SetGeodetic (double longitude, double latitude, double altitude, const EllipsoidParams &ellipsoid=GeoCoord::WGS84)
 
void GetGeodetic (Vector *lonLatAlt, const EllipsoidParams &ellipsoid=GeoCoord::WGS84) const
 
void GetGeodetic (double *longitude, double *latitude, double *altitude, const EllipsoidParams &ellipsoid=GeoCoord::WGS84) const
 
void SetGeocentric (const Vector &value)
 
void SetGeocentric (double x, double y, double z)
 
void GetGeocentric (Vector *value) const
 
void GetGeocentric (double *x, double *y, double *z) const
 
bool operator== (const GeoCoord &other) const
 
bool operator!= (const GeoCoord &other) const
 

Static Public Member Functions

static void GeocentricToGeodetic (double xp, double yp, double zp, double *lon, double *lat, double *alt, const EllipsoidParams &ellipsoid=GeoCoord::WGS84)
 
static void GeodeticToGeocentric (double lon, double lat, double alt, double *xp, double *yp, double *zp, const EllipsoidParams &ellipsoid=GeoCoord::WGS84)
 
static void UTMToGeodetic (const double northing, const double easting, double &lat_degrees, double &lon_degrees)
 
static void UTMToGeodetic (const double northing, const double easting, const int zone, const int latZoneIndex, double &lat_degrees, double &lon_degrees)
 
static void GeodeticToUTM (const double lat_degrees, const double lon_degrees, double &northing, double &easting)
 
static int CalcZone (double lon_radians)
 
static int CalcZoneDeg (double longitude_degrees)
 
static char CalcLatZoneDeg (double lat_degrees)
 
static int CalcLatZoneDegIndex (double lat_degrees)
 
static void GetSphericalDistanceAndBearing (const GeoCoord &coord1, const GeoCoord &coord2, double *distance, double *bearing, const double radius=6372795.477598)
 
static void GetPointAtDistanceAndBearingSpherical (const GeoCoord &origin, double distance, double bearing, GeoCoord *destination, const double radius=6372795.477598)
 

Static Public Attributes

static const EllipsoidParams WGS84
 

Protected Types

enum  ValueFlags { VAL_GEODETIC_WGS84 = 1 , VAL_GEOCENTRIC = 2 }
 

Protected Member Functions

void GetGeodeticNonWGS84 (double *longitude, double *latitude, double *altitude, const EllipsoidParams &ellipsoid=GeoCoord::WGS84) const
 
void SetGeodeticNonWGS84 (double longitude, double latitude, double altitude, const EllipsoidParams &ellipsoid=GeoCoord::WGS84)
 
void UpdateGeodeticWGS84Value () const
 
void UpdateGeocentricValue () const
 

Static Protected Member Functions

static bool closeValues (double lv, double rv)
 
static void CalcFalseNorthEast (double lat_radians)
 
static void CalcLambda0 ()
 

Protected Attributes

unsigned char _validValues
 
double _lon
 
double _lat
 
double _alt
 
double _x
 
double _y
 
double _z
 

Static Protected Attributes

static double _False_Northing = 0.0
 
static double _False_Easting = 0.0
 
static double _Zone = 0.0
 
static double _Lambda0 = 0.0
 
static const char _LatZone [20] = { 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X' }
 

Detailed Description

The GeoCoord class encapsulates a location relative to the earth. It is possible to get and set the value in a number of different coordinate systems.

Member Function Documentation

◆ GeocentricToGeodetic()

void disti::GeoCoord::GeocentricToGeodetic ( double  xp,
double  yp,
double  zp,
double *  lon,
double *  lat,
double *  alt,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
)
static

Utility method to convert from geocentric to geodetic coordinates

◆ GeodeticToGeocentric()

void disti::GeoCoord::GeodeticToGeocentric ( double  lon,
double  lat,
double  alt,
double *  xp,
double *  yp,
double *  zp,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
)
static

Utility method to convert from geodetic to geocentric coordinates

◆ GeodeticToUTM()

void disti::GeoCoord::GeodeticToUTM ( const double  lat_degrees,
const double  lon_degrees,
double &  northing,
double &  easting 
)
static

(RAT)************************************************************* poly1 = 1.0 - (e_sq/4.0) - (3.0*e_sq*e_sq)/64.0 - 5.0*pow(e_sq,3.0)/256.0; poly2 = 3.0*e_sq/8.0 + (3.0*e_sq*e_sq)/32.0 + 45.0*pow(e_sq, 3.0)/1024.0; poly3 = 15.0*e_sq*e_sq/256.0 + 45.0*pow(e_sq, 3.0)/1024.0; poly4 = 35.0*pow(e_sq, 3.0)/3072.0;

◆ GetGeocentric() [1/2]

void disti::GeoCoord::GetGeocentric ( double *  x,
double *  y,
double *  z 
) const
inline

Get GeoCoord value in geocentric coordinates

Parameters
xpointer to a double to receive the x coordinate value
ypointer to a double to receive the y coordinate value
zpointer to a double to receive the z coordinate value

◆ GetGeocentric() [2/2]

void disti::GeoCoord::GetGeocentric ( Vector *  value) const
inline

Get GeoCoord value in geocentric coordinates

Parameters
valuepointer to a vector to receive the value

◆ GetGeodetic() [1/2]

void disti::GeoCoord::GetGeodetic ( double *  longitude,
double *  latitude,
double *  altitude,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
) const
inline

Get GeoCoord value in geodetic coordinates

Parameters
longitudepointer to a double to receive the longitude in degrees
latitudepointer to a double to receive the latitude in degrees
altitudepointer to a double to receive the altitude in meters
ellipsoidEllipsoid type

◆ GetGeodetic() [2/2]

void disti::GeoCoord::GetGeodetic ( Vector *  lonLatAlt,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
) const
inline

Get GeoCoord value in geodetic coordinates

Parameters
lonLatAltpointer to a vector to receive the value ( x = longitude, y = latitude, z = altitude )
ellipsoidEllipsoid type

◆ GetPointAtDistanceAndBearingSpherical()

void disti::GeoCoord::GetPointAtDistanceAndBearingSpherical ( const GeoCoord origin,
double  distance,
double  bearing,
GeoCoord destination,
const double  radius = 6372795.477598 
)
static

Calculate a new point given the distance and initial bearing from a known origin. The new point is located on the 'great circle' arc defined by the parameters.

Parameters
originThe starting point
distanceDistance to the destination in meters
bearingInitial bearing from the origin in degrees from true north
destinationPointer to a GeoCoord to receive the destination point
radius(optional) Radius of the sphere. Default value is the average radius of the earth (6372795.477598 meters)

◆ GetSphericalDistanceAndBearing()

void disti::GeoCoord::GetSphericalDistanceAndBearing ( const GeoCoord coord1,
const GeoCoord coord2,
double *  distance,
double *  bearing,
const double  radius = 6372795.477598 
)
static

Calculate the 'great circle' distance and initial bearing between two points along the surface of a sphere using the Haversine formula.

Parameters
coord1First point
coord2Second point
distancePointer to a double to receive the distance in meters
bearingPointer to a double to receive the initial bearing from coord1 to coord2 in degrees from true north
radius(optional) Radius of the sphere. Default value is the average radius of the earth (6372795.477598 meters)

◆ operator!=()

bool disti::GeoCoord::operator!= ( const GeoCoord other) const
inline

Determine if two GeoCoords do not have equivalent values

Parameters
otherThe GeoCoord to compare to

◆ operator==()

bool disti::GeoCoord::operator== ( const GeoCoord other) const
inline

Determine if two GeoCoords have equivalent values

Parameters
otherThe GeoCoord to compare to

◆ SetGeocentric() [1/2]

void disti::GeoCoord::SetGeocentric ( const Vector &  value)
inline

Set GeoCoord value in geocentric coordinates

Parameters
valueVector containing new geocentric coordinate in meters

◆ SetGeocentric() [2/2]

void disti::GeoCoord::SetGeocentric ( double  x,
double  y,
double  z 
)
inline

Set GeoCoord value in geocentric coordinates

Parameters
xNew x coordinate value in meters
yNew y coordinate value in meters
zNew z coordinate value in meters

◆ SetGeodetic() [1/2]

void disti::GeoCoord::SetGeodetic ( const Vector &  lonLatAlt,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
)
inline

Set GeoCoord value in geodetic coordinates

Parameters
lonLatAltVector where x = longitude, y = latitude, z = altitude
ellipsoidEllipsoid type

◆ SetGeodetic() [2/2]

void disti::GeoCoord::SetGeodetic ( double  longitude,
double  latitude,
double  altitude,
const EllipsoidParams ellipsoid = GeoCoord::WGS84 
)
inline

Set GeoCoord value in geodetic coordinates

Parameters
longitudeLongitude in degrees
latitudeLatitude in degrees
altitudeAltitude in meters
ellipsoidEllipsoid type

The documentation for this class was generated from the following files: