GeoCoordinate Class Reference
Geographic coordinate.
More...
#include <geocoordinate.h>
List of all members.
Detailed Description
Geographic coordinate.
- Author:
- Jussi Laitinen - jussi.laitinen@ixonos.com
-
Sami Rämö - sami.ramo@ixonos.com
Constructor & Destructor Documentation
GeoCoordinate::GeoCoordinate |
( |
double |
latitude, |
|
|
double |
longitude | |
|
) |
| | |
Constructs a coordinate with given latitude and longitude values.
- Parameters:
-
| latitude | Latitude value |
| longitude | Longitude value |
Constructs a coordinate with values converted from the given SceneCoordinate.
- Parameters:
-
| coordinate | Scene coordinate |
Member Function Documentation
void GeoCoordinate::convertFrom |
( |
const SceneCoordinate & |
coordinate |
) |
[private] |
Convert values from SceneCoordinate.
- Parameters:
-
| coordinate | Scene coordinate |
qreal GeoCoordinate::distanceTo |
( |
const GeoCoordinate & |
other |
) |
const |
Distance to other coordinate.
This calculation returns the great-circle distance between the two coordinates, with an assumption that the Earth is spherical. Calculation is done using haversine formula. Altitude is not used in the calculation.
- Parameters:
-
| other | Coordinate where the distance is calculated from this coordinate |
- Returns:
- Distance to other coordinate (in meters)
bool GeoCoordinate::isNull |
( |
|
) |
const |
Check if coordinate is (0.0, 0.0).
- Returns:
- True if both latitude and longitude are 0.0, otherwise false
bool GeoCoordinate::isValid |
( |
|
) |
|
Check if coordinate is valid.
Latitude and longitude values must be set, latitude must be -90..90 and longitude must be -180..180 for valid coordinate.
- Returns:
- true if coordinate is valid, false otherwise
double GeoCoordinate::latitude |
( |
|
) |
const |
Returns the latitude value.
- Returns:
- latitude
double GeoCoordinate::longitude |
( |
|
) |
const |
Returns the longitude value.
- Returns:
- longitude
void GeoCoordinate::registerMetaType |
( |
|
) |
[private] |
Register meta type and stream operators for using the class with QVariant and QSetting.
Registering is done only once at the first time the GeoCoordinate object is constructed.
void GeoCoordinate::setLatitude |
( |
double |
latitude |
) |
|
Sets the latitude.
- Parameters:
-
void GeoCoordinate::setLongitude |
( |
double |
longitude |
) |
|
Sets the longitude.
- Parameters:
-
| longitude | Longitude value |
Friends And Related Function Documentation
Subtract operator.
- Returns:
- Returns a GeoCoordinate object that is formed by subtracting coordinate2 from coordinate1. Each component is subtracted separately.
QDataStream& operator<< |
( |
QDataStream & |
out, |
|
|
const GeoCoordinate & |
coordinate | |
|
) |
| | [friend] |
Output operator.
- Parameters:
-
| out | Output stream |
| coordinate | Coordinate object which is written to the stream |
QDataStream& operator>> |
( |
QDataStream & |
in, |
|
|
GeoCoordinate & |
coordinate | |
|
) |
| | [friend] |
Input operator.
- Parameters:
-
| in | Input stream |
| coordinate | Object where the values from the stream are saved |
The documentation for this class was generated from the following files: