#include <lbsposition.h>
class TCoordinate |
Protected Attributes | |
---|---|
TReal32 | iAltitude |
TPositionDatumId | iDatum |
TReal64 | iLatitude |
TReal64 | iLongitude |
TUint8 | iReserved |
Public Member Functions | |
---|---|
TCoordinate() | |
TCoordinate(const TReal64 &, const TReal64 &) | |
TCoordinate(const TReal64 &, const TReal64 &, TReal32) | |
IMPORT_C TReal32 | Altitude() |
IMPORT_C TInt | BearingTo(const TCoordinate &, TReal32 &) |
IMPORT_C TPositionDatumId | Datum() |
IMPORT_C TInt | Distance(const TCoordinate &, TReal32 &) |
IMPORT_C TReal64 | Latitude() |
IMPORT_C TReal64 | Longitude() |
IMPORT_C TInt | Move(TReal32, TReal32) |
IMPORT_C void | SetCoordinate(const TReal64 &, const TReal64 &) |
IMPORT_C void | SetCoordinate(const TReal64 &, const TReal64 &, TReal32) |
IMPORT_C void | SetDatum(TPositionDatumId) |
TCoordinate is used to hold the basic coordinates of a location (latitude, longitude and altitude).
TPositionDatumId | iDatum | [protected] |
The ID of the datum the coordinate is in, defaults to WGS-84 format.
TReal64 | iLongitude | [protected] |
Longitude, defaults to WGS-84 format. Represented in degree.
IMPORT_C | TCoordinate | ( | ) |
Default constructor for TCoordinate. Sets the member data to default values (NaN).
Constructor for TCoordinate. Allows the client to set just latitude and longitude, and sets the altitude to its default value (NaN).
Parameter | Description |
---|---|
aLatitude | specifies an initial value for latitude. |
aLongitude | specifies an initial value for longitude. |
Constructor for TCoordinate. Allows the client to set the latitude, longitude and altitude.
Parameter | Description |
---|---|
aLatitude | specifies an initial value for latitude. |
aLongitude | specifies an initial value for longitude. |
aAltitude | specifies an initial value for altitude. |
IMPORT_C TReal32 | Altitude | ( | ) | const |
Accessor for altitude. The altitude is represented in meters.
Returns: the altitude component of this coordinate, in metres.
IMPORT_C TInt | BearingTo | ( | const TCoordinate & | aTargetCoordinate, |
TReal32 & | aBearing | |||
) | const |
This method calculates the bearing from this coordinate to the supplied coordinate.
Parameter | Description |
---|---|
aTargetCoordinate | is the supplied target coordinate. |
aBearing | upon successful completion, this is set to the bearing from this coordinate to aTargetCoordinate, in degrees counting clockwise relative to true north. |
Returns: a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aTargetCoordinate.iLatitude or aTargetCoordinate.iLongitude are set to NaN. KErrPositionIncalculable if this coordinate is at a pole or if the two coordinates are the same or antipodal.
IMPORT_C TPositionDatumId | Datum | ( | ) | const |
Accessor for the datum.
Returns: the datum of this coordinate.
IMPORT_C TInt | Distance | ( | const TCoordinate & | aCoordinate, |
TReal32 & | aDistance | |||
) | const |
This method calculates the distance between this coordinate and the supplied coordinate.
Parameter | Description |
---|---|
aCoordinate | is another point to use in the calculation. |
aDistance | upon successful completion, this is set to the distance between this coordinate and aCoordinate, in metres. |
Returns: a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aCoordinate.iLatitude or aCoordinate.iLongitude are set to NaN.
IMPORT_C TReal64 | Latitude | ( | ) | const |
Accessor for latitude. The latitude is represented in degrees.
Returns: the latitude component of this coordinate.
IMPORT_C TReal64 | Longitude | ( | ) | const |
Accessor for longitude. The longitude is represented in degrees.
Returns: the longitude component of this coordinate.
This method moves this coordinate aDistance in the direction specified by aBearing
Parameter | Description |
---|---|
aBearing | is the direction to move this coordinate, in degrees counting clockwise relative to true north. |
aDistance | is the distance to move this coordinate, in metres. |
Returns: a Symbian OS error code. KErrArgument if any of iLongitude or iLatitude are set to NaN. KErrPositionIncalculable if this coordinate is at a pole.
This method assigns a new latitude and longitude to the object. The altitude is set to its default value.
Parameter | Description |
---|---|
aLatitude | specifies a new latitude. The latitude is represented in degrees. |
aLongitude | specifies a new longitude. The longitude is represented in degrees. |
This method assigns a new latitude, longitude and altitude to the object.
Parameter | Description |
---|---|
aLatitude | specifies a new latitude. The latitude is represented in degrees. |
aLongitude | specifies a new longitude. The longitude is represented in degrees. |
aAltitude | specifies a new altitude. The altitude is represented in meters. |
IMPORT_C void | SetDatum | ( | TPositionDatumId | aDatum | ) |
This method assigns a new datum to the object.
Parameter | Description |
---|---|
aDatum | specifies a new datum. |