GL Studio C++ Runtime API
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 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)
 

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

static void 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

static void 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

void GetGeocentric ( Vector value) const
inline

Get GeoCoord value in geocentric coordinates

Parameters
valuepointer to a vector to receive the value
void 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
void 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
void 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
static void 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)
static void 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)
bool operator!= ( const GeoCoord other) const
inline

Determine if two GeoCoords do not have equivalent values

Parameters
otherThe GeoCoord to compare to
bool operator== ( const GeoCoord other) const
inline

Determine if two GeoCoords have equivalent values

Parameters
otherThe GeoCoord to compare to
void SetGeocentric ( const Vector value)
inline

Set GeoCoord value in geocentric coordinates

Parameters
valueVector containing new geocentric coordinate in meters
void 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
void 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
void 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 file: