Simple World Geodetic System (WGS) latitude and longitude coordinate system data structure. More...
#include <coordinates.h>
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. | |
Wgs & | operator() (const double lat, const double lon, const double elev) |
Sets the values. | |
Wgs & | operator= (const Wgs &wgs) |
Sets equal to. | |
Wgs & | operator<< (const Utm &utm) |
Converts the UTM data to WGS, and saves it to internal data members. | |
Wgs & | operator<< (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]. |
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.
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.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
Definition at line 394 of file coordinates.cpp.
Wgs::Wgs | ( | const double | latitude, |
const double | longitude, | ||
const double | elevation | ||
) |
Constructor.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
elevation | Elevation as ASL format [-10,000, 30,000] meters. |
Definition at line 408 of file coordinates.cpp.
int Wgs::Get | ( | double & | latitude, |
double & | longitude | ||
) | const |
Gets the values.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
Definition at line 560 of file coordinates.cpp.
int Wgs::Get | ( | double & | latitude, |
double & | longitude, | ||
double & | elevation | ||
) | const |
Gets the values.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
elevation | Elevation around mean-sea level [-10,000,35,000]. |
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.
latDeg | Degrees portion of latitude. |
latMin | Minutes portion of latitude. |
latSec | Seconds portion of latitude. |
lonDeg | Degrees porition of longitude. |
lonMin | Minute portion of longitude. |
lonSec | Seconds portion of longitude. |
elevation | Elevation around mean-sea level [-10,000,35,000]. |
Definition at line 603 of file coordinates.cpp.
Computes the great circle distance between two points.
p1 | The first point. |
p2 | The second point. |
Definition at line 677 of file coordinates.cpp.
Wgs & Wgs::operator() | ( | const double | lat, |
const double | lon, | ||
const double | elev | ||
) |
Sets the values.
lat | Latitude. |
lon | Longitude. |
elev | Elevation.. |
Definition at line 700 of file coordinates.cpp.
Converts the UTM data to WGS, and saves it to internal data members.
Definition at line 727 of file coordinates.cpp.
Converts the GCC data to WGS, and saves it to internal data members.
Definition at line 783 of file coordinates.cpp.
Sets equal to.
Definition at line 711 of file coordinates.cpp.
bool Wgs::operator== | ( | const Wgs & | wgs ) | const |
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.
latDeg | Degrees portion of latitude. |
latMin | Minutes portion of latitude. |
latSec | Seconds portion of latitude. |
lonDeg | Degrees porition of longitude. |
lonMin | Minute portion of longitude. |
lonSec | Secons portion of longitude. |
Definition at line 481 of file coordinates.cpp.
int Wgs::Set | ( | const double | latitude, |
const double | longitude | ||
) |
Sets the values.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
Definition at line 425 of file coordinates.cpp.
int Wgs::Set | ( | const double | latitude, |
const double | longitude, | ||
const double | elevation | ||
) |
Sets the values.
latitude | Latitude [-90,90]. |
longitude | Longitude [-180, 180]. |
elevation | Elevation around mean-sea level [-10,000,35,000]. |
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.
latDeg | Degrees portion of latitude. |
latMin | Minutes portion of latitude. |
latSec | Seconds portion of latitude. |
lonDeg | Degrees porition of longitude. |
lonMin | Minute portion of longitude. |
lonSec | Seconds portion of longitude. |
elevation | Elevation around mean-sea level [-10,000,35,000]. |
Definition at line 523 of file coordinates.cpp.
std::string Wgs::ToString | ( | const bool | degreesMinutesFlag = false ) |
const |
Converts the WGS data to a string.
degreesMinutesFlag | If true, data is displayed in degrees.minutes format. |
Definition at line 647 of file coordinates.cpp.
double CxUtils::Wgs::mElevation |
Elevation based on mean-sea level [-10,000, 35,000].
Definition at line 105 of file coordinates.h.
double CxUtils::Wgs::mLatitude |
Latittude in degrees [-90,90].
Definition at line 103 of file coordinates.h.
double CxUtils::Wgs::mLongitude |
Longitude in degrees [-180,180].
Definition at line 104 of file coordinates.h.