Public Member Functions | Static Public Member Functions | Public Attributes

CxUtils::Wgs Class Reference

Simple World Geodetic System (WGS) latitude and longitude coordinate system data structure. More...

#include <coordinates.h>

List of all members.

Public Member Functions

 Wgs ()
 Constructor.
 Wgs (const Wgs &wgs)
 Copy constructor.
 Wgs (const Utm &utm)
 Initializes from UTM coordinate.
 Wgs (const double latitude, const double longitude)
 Constructor.
 Wgs (const double latitude, const double longitude, const double elevation)
 Constructor.
int Set (const double latitude, const double longitude)
 Sets the values.
int Set (const double latitude, const double longitude, const double elevation)
 Sets the values.
int Set (const double latDeg, const double latMin, const double latSec, const double lonDeg, const double lonMin, const double lonSec)
 Sets the values. Converts from degrees minutes seconds to degrees.
int Set (const double latDeg, const double latMin, const double latSec, const double lonDeg, const double lonMin, const double lonSec, const double elevation)
 Sets the values. Converts from degrees minutes seconds to degrees.
int Get (double &latitude, double &longitude) const
 Gets the values.
int Get (double &latitude, double &longitude, double &elevation) const
 Gets the values.
int Get (double &latDeg, double &latMin, double &latSec, double &lonDeg, double &lonMin, double &lonSec, double &elevation) const
 Gets the values in degrees.minutes.seconds format.
void Print () const
 Prints out data to console.
std::string ToString (const bool degreesMinutesFlag=false) const
 Converts the WGS data to a string.
Wgsoperator() (const double lat, const double lon, const double elev)
 Sets the values.
Wgsoperator= (const Wgs &wgs)
 Sets equal to.
Wgsoperator<< (const Utm &utm)
 Converts the UTM data to WGS, and saves it to internal data members.
Wgsoperator<< (const Gcc &gcc)
 Converts the GCC data to WGS, and saves it to internal data members.
void operator>> (Utm &utm) const
 Converts to UTM position data.
bool operator== (const Wgs &wgs) const
void operator>> (Gcc &gcc) const
 Converts to GCC position data.

Static Public Member Functions

static double GreatCircleDistance (const Wgs &p1, const Wgs &p2)
 Computes the great circle distance between two points.

Public Attributes

double mLatitude
 Latittude in degrees [-90,90].
double mLongitude
 Longitude in degrees [-180,180].
double mElevation
 Elevation based on mean-sea level [-10,000, 35,000].

Detailed Description

Simple World Geodetic System (WGS) latitude and longitude coordinate system data structure.

All coordinate conversions are done using WGS84 values.

Definition at line 73 of file coordinates.h.


Constructor & Destructor Documentation

Wgs::Wgs (  )

Constructor.

Definition at line 357 of file coordinates.cpp.

Wgs::Wgs ( const Wgs wgs )

Copy constructor.

Definition at line 368 of file coordinates.cpp.

Wgs::Wgs ( const Utm utm )

Initializes from UTM coordinate.

Definition at line 379 of file coordinates.cpp.

Wgs::Wgs ( const double  latitude,
const double  longitude 
)

Constructor.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].

Definition at line 394 of file coordinates.cpp.

Wgs::Wgs ( const double  latitude,
const double  longitude,
const double  elevation 
)

Constructor.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].
elevationElevation as ASL format [-10,000, 30,000] meters.

Definition at line 408 of file coordinates.cpp.


Member Function Documentation

int Wgs::Get ( double &  latitude,
double &  longitude 
) const

Gets the values.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].
Returns:
1 if values retrieved, otherwise 0.

Definition at line 560 of file coordinates.cpp.

int Wgs::Get ( double &  latitude,
double &  longitude,
double &  elevation 
) const

Gets the values.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].
elevationElevation around mean-sea level [-10,000,35,000].
Returns:
1 if values retrieved, otherwise 0.

Definition at line 579 of file coordinates.cpp.

int Wgs::Get ( double &  latDeg,
double &  latMin,
double &  latSec,
double &  lonDeg,
double &  lonMin,
double &  lonSec,
double &  elevation 
) const

Gets the values in degrees.minutes.seconds format.

Parameters:
latDegDegrees portion of latitude.
latMinMinutes portion of latitude.
latSecSeconds portion of latitude.
lonDegDegrees porition of longitude.
lonMinMinute portion of longitude.
lonSecSeconds portion of longitude.
elevationElevation around mean-sea level [-10,000,35,000].
Returns:
1 if values retrieved, otherwise 0.

Definition at line 603 of file coordinates.cpp.

double Wgs::GreatCircleDistance ( const Wgs p1,
const Wgs p2 
) [static]

Computes the great circle distance between two points.

Parameters:
p1The first point.
p2The second point.
Returns:
Great circle distance between to GPS waypoints in meters.

Definition at line 677 of file coordinates.cpp.

Wgs & Wgs::operator() ( const double  lat,
const double  lon,
const double  elev 
)

Sets the values.

Parameters:
latLatitude.
lonLongitude.
elevElevation..

Definition at line 700 of file coordinates.cpp.

Wgs & Wgs::operator<< ( const Utm utm )

Converts the UTM data to WGS, and saves it to internal data members.

Definition at line 727 of file coordinates.cpp.

Wgs & Wgs::operator<< ( const Gcc gcc )

Converts the GCC data to WGS, and saves it to internal data members.

Definition at line 783 of file coordinates.cpp.

Wgs & Wgs::operator= ( const Wgs wgs )

Sets equal to.

Definition at line 711 of file coordinates.cpp.

bool Wgs::operator== ( const Wgs wgs ) const
Returns:
True if the values are equal, otherwise false.

Definition at line 907 of file coordinates.cpp.

void Wgs::operator>> ( Gcc gcc ) const [inline]

Converts to GCC position data.

Definition at line 886 of file coordinates.cpp.

void Wgs::operator>> ( Utm utm ) const

Converts to UTM position data.

Definition at line 819 of file coordinates.cpp.

void Wgs::Print (  ) const

Prints out data to console.

Definition at line 631 of file coordinates.cpp.

int Wgs::Set ( const double  latDeg,
const double  latMin,
const double  latSec,
const double  lonDeg,
const double  lonMin,
const double  lonSec 
)

Sets the values. Converts from degrees minutes seconds to degrees.

Parameters:
latDegDegrees portion of latitude.
latMinMinutes portion of latitude.
latSecSeconds portion of latitude.
lonDegDegrees porition of longitude.
lonMinMinute portion of longitude.
lonSecSecons portion of longitude.
Returns:
1 if values set, otherwise 0.

Definition at line 481 of file coordinates.cpp.

int Wgs::Set ( const double  latitude,
const double  longitude 
)

Sets the values.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].
Returns:
1 if values set, otherwise 0.

Definition at line 425 of file coordinates.cpp.

int Wgs::Set ( const double  latitude,
const double  longitude,
const double  elevation 
)

Sets the values.

Parameters:
latitudeLatitude [-90,90].
longitudeLongitude [-180, 180].
elevationElevation around mean-sea level [-10,000,35,000].
Returns:
1 if values set, otherwise 0.

Definition at line 450 of file coordinates.cpp.

int Wgs::Set ( const double  latDeg,
const double  latMin,
const double  latSec,
const double  lonDeg,
const double  lonMin,
const double  lonSec,
const double  elevation 
)

Sets the values. Converts from degrees minutes seconds to degrees.

Parameters:
latDegDegrees portion of latitude.
latMinMinutes portion of latitude.
latSecSeconds portion of latitude.
lonDegDegrees porition of longitude.
lonMinMinute portion of longitude.
lonSecSeconds portion of longitude.
elevationElevation around mean-sea level [-10,000,35,000].
Returns:
1 if values set, otherwise 0.

Definition at line 523 of file coordinates.cpp.

std::string Wgs::ToString ( const bool  degreesMinutesFlag = false ) const

Converts the WGS data to a string.

Parameters:
degreesMinutesFlagIf true, data is displayed in degrees.minutes format.
Returns:
WGS data as a string.

Definition at line 647 of file coordinates.cpp.


Member Data Documentation

Elevation based on mean-sea level [-10,000, 35,000].

Definition at line 105 of file coordinates.h.

Latittude in degrees [-90,90].

Definition at line 103 of file coordinates.h.

Longitude in degrees [-180,180].

Definition at line 104 of file coordinates.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines