Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <LbsPosition.h>
Link against: lbs.lib
Link against: lbsselflocate.lib

Class TCoordinate

class TCoordinate;

Description

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

Members

Defined in TCoordinate:


Construction and destruction


TCoordinate()

IMPORT_C TCoordinate();

Description

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


TCoordinate(const TReal64 &,const TReal64 &)

IMPORT_C TCoordinate(const TReal64 &aLatitude, const TReal64 &aLongitude);

Description

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

Parameters

const TReal64 &aLatitude

specifies an initial value for latitude.

const TReal64 &aLongitude

specifies an initial value for longitude.


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

IMPORT_C TCoordinate(const TReal64 &aLatitude, const TReal64 &aLongitude, TReal32 aAltitude);

Description

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

Parameters

const TReal64 &aLatitude

specifies an initial value for latitude.

const TReal64 &aLongitude

specifies an initial value for longitude.

TReal32 aAltitude

specifies an initial value for altitude.

[Top]


Member functions


SetCoordinate(const TReal64 &,const TReal64 &)

IMPORT_C void SetCoordinate(const TReal64 &aLatitude, const TReal64 &aLongitude);

Description

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

Parameters

const TReal64 &aLatitude

specifies a new latitude.

const TReal64 &aLongitude

specifies a new longitude.


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

IMPORT_C void SetCoordinate(const TReal64 &aLatitude, const TReal64 &aLongitude, TReal32 aAltitude);

Description

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

Parameters

const TReal64 &aLatitude

specifies a new latitude.

const TReal64 &aLongitude

specifies a new longitude.

TReal32 aAltitude

specifies a new altitude.


SetDatum(TPositionDatumId)

IMPORT_C void SetDatum(TPositionDatumId aDatum);

Description

This method assigns a new datum to the object.

Parameters

TUid aDatum

specifies a new datum.


Latitude()const

IMPORT_C TReal64 Latitude() const;

Description

Accessor for latitude.

Return value

TReal64

the latitude component of this coordinate.


Longitude()const

IMPORT_C TReal64 Longitude() const;

Description

Accessor for longitude.

Return value

TReal64

the longitude component of this coordinate.


Altitude()const

IMPORT_C TReal32 Altitude() const;

Description

Accessor for altitude.

Return value

TReal32

the altitude component of this coordinate, in metres.


Datum()const

IMPORT_C TPositionDatumId Datum() const;

Description

Accessor for the datum.

Return value

TUid

the datum of this coordinate.


Distance(const TCoordinate &,TReal32 &)const

IMPORT_C TInt Distance(const TCoordinate &aCoordinate, TReal32 &aDistance) const;

Description

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

Parameters

const TCoordinate &aCoordinate

is another point to use in the calculation.

TReal32 &aDistance

upon successful completion, this is set to the distance between this coordinate and aCoordinate, in metres.

Return value

TInt

a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aCoordinate.iLatitude or aCoordinate.iLongitude are set to NaN.


BearingTo(const TCoordinate &,TReal32 &)const

IMPORT_C TInt BearingTo(const TCoordinate &aTargetCoordinate, TReal32 &aBearing) const;

Description

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

Parameters

const TCoordinate &aTargetCoordinate

is the supplied target coordinate.

TReal32 &aBearing

upon successful completion, this is set to the bearing from this coordinate to aTargetCoordinate, in degrees counting clockwise relative to true north.

Return value

TInt

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.


Move(TReal32,TReal32)

IMPORT_C TInt Move(TReal32 aBearing, TReal32 aDistance);

Description

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

Parameters

TReal32 aBearing

is the direction to move this coordinate, in degrees counting clockwise relative to true north.

TReal32 aDistance

is the distance to move this coordinate, in metres.

Return value

TInt

a Symbian OS error code. KErrArgument if any of iLongitude or iLatitude are set to NaN. KErrPositionIncalculable if this coordinate is at a pole.

[Top]


Member data


iLatitude

protected: TReal64 iLatitude;

Description

Latitude, defaults to WGS-84 format.


iLongitude

protected: TReal64 iLongitude;

Description

Longitude, defaults to WGS-84 format.


iAltitude

protected: TReal32 iAltitude;

Description

Altitude, defaults to WGS-84 format.


iDatum

protected: TPositionDatumId iDatum;

Description

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


iReserved

protected: TUint8 iReserved[4];

Description

Unused variable for future expansion.