TCoordinate Class Reference

#include <lbsposition.h>

Link against: lbs.lib

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 TReal32Altitude()
IMPORT_C TIntBearingTo(const TCoordinate &, TReal32 &)
IMPORT_C TPositionDatumIdDatum()
IMPORT_C TIntDistance(const TCoordinate &, TReal32 &)
IMPORT_C TReal64Latitude()
IMPORT_C TReal64Longitude()
IMPORT_C TIntMove(TReal32, TReal32)
IMPORT_C voidSetCoordinate(const TReal64 &, const TReal64 &)
IMPORT_C voidSetCoordinate(const TReal64 &, const TReal64 &, TReal32)
IMPORT_C voidSetDatum(TPositionDatumId)

Detailed Description

TCoordinate is used to hold the basic coordinates of a location (latitude, longitude and altitude).

Member Attribute Documentation

iAltitude

TReal32 iAltitude[protected]

Altitude, defaults to WGS-84 format. Represented in meters.

iDatum

TPositionDatumId iDatum[protected]

The ID of the datum the coordinate is in, defaults to WGS-84 format.

iLatitude

TReal64 iLatitude[protected]

Latitude, defaults to WGS-84 format. Represented in degree.

iLongitude

TReal64 iLongitude[protected]

Longitude, defaults to WGS-84 format. Represented in degree.

iReserved

TUint8 iReserved[protected]

Unused variable for future expansion.

Constructor & Destructor Documentation

TCoordinate ( )

IMPORT_CTCoordinate()

Default constructor for TCoordinate. Sets the member data to default values (NaN).

TCoordinate ( const TReal64 &, const TReal64 & )

IMPORT_CTCoordinate(const TReal64 &aLatitude,
const TReal64 &aLongitude
)

Constructor for TCoordinate. Allows the client to set just latitude and longitude, and sets the altitude to its default value (NaN).

Parameters
aLatitudespecifies an initial value for latitude.
aLongitudespecifies an initial value for longitude.

TCoordinate ( const TReal64 &, const TReal64 &, TReal32 )

IMPORT_CTCoordinate(const TReal64 &aLatitude,
const TReal64 &aLongitude,
TReal32aAltitude
)

Constructor for TCoordinate. Allows the client to set the latitude, longitude and altitude.

Parameters
aLatitudespecifies an initial value for latitude.
aLongitudespecifies an initial value for longitude.
aAltitudespecifies an initial value for altitude.

Member Function Documentation

Altitude ( )

IMPORT_C TReal32Altitude()const

Accessor for altitude. The altitude is represented in meters.

Return Value
the altitude component of this coordinate, in metres.

BearingTo ( const TCoordinate &, TReal32 & )

IMPORT_C TIntBearingTo(const TCoordinate &aTargetCoordinate,
TReal32 &aBearing
)const

This method calculates the bearing from this coordinate to the supplied coordinate.

Parameters
aTargetCoordinateis the supplied target coordinate.
aBearingupon successful completion, this is set to the bearing from this coordinate to aTargetCoordinate, in degrees counting clockwise relative to true north.
Return Value
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.

Datum ( )

IMPORT_C TPositionDatumIdDatum()const

Accessor for the datum.

Return Value
the datum of this coordinate.

Distance ( const TCoordinate &, TReal32 & )

IMPORT_C TIntDistance(const TCoordinate &aCoordinate,
TReal32 &aDistance
)const

This method calculates the distance between this coordinate and the supplied coordinate.

Parameters
aCoordinateis another point to use in the calculation.
aDistanceupon successful completion, this is set to the distance between this coordinate and aCoordinate, in metres.
Return Value
a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aCoordinate.iLatitude or aCoordinate.iLongitude are set to NaN.

Latitude ( )

IMPORT_C TReal64Latitude()const

Accessor for latitude. The latitude is represented in degrees.

Return Value
the latitude component of this coordinate.

Longitude ( )

IMPORT_C TReal64Longitude()const

Accessor for longitude. The longitude is represented in degrees.

Return Value
the longitude component of this coordinate.

Move ( TReal32, TReal32 )

IMPORT_C TIntMove(TReal32aBearing,
TReal32aDistance
)

This method moves this coordinate aDistance in the direction specified by aBearing

Parameters
aBearingis the direction to move this coordinate, in degrees counting clockwise relative to true north.
aDistanceis the distance to move this coordinate, in metres.
Return Value
a Symbian OS error code. KErrArgument if any of iLongitude or iLatitude are set to NaN. KErrPositionIncalculable if this coordinate is at a pole.

SetCoordinate ( const TReal64 &, const TReal64 & )

IMPORT_C voidSetCoordinate(const TReal64 &aLatitude,
const TReal64 &aLongitude
)

This method assigns a new latitude and longitude to the object. The altitude is set to its default value.

Parameters
aLatitudespecifies a new latitude. The latitude is represented in degrees.
aLongitudespecifies a new longitude. The longitude is represented in degrees.

SetCoordinate ( const TReal64 &, const TReal64 &, TReal32 )

IMPORT_C voidSetCoordinate(const TReal64 &aLatitude,
const TReal64 &aLongitude,
TReal32aAltitude
)

This method assigns a new latitude, longitude and altitude to the object.

Parameters
aLatitudespecifies a new latitude. The latitude is represented in degrees.
aLongitudespecifies a new longitude. The longitude is represented in degrees.
aAltitudespecifies a new altitude. The altitude is represented in meters.

SetDatum ( TPositionDatumId )

IMPORT_C voidSetDatum(TPositionDatumIdaDatum)

This method assigns a new datum to the object.

Parameters
aDatumspecifies a new datum.