Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

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

Class TLocality

class TLocality : public TCoordinate;

Description

Adds an error estimate for the horizontal and vertical accuracy of the point to TCoordinate. Accuracy information is held in a TReal32 and is measure in metres. The class also provides its own methods for determining the distance and bearing to a target point. These methods also provide an error estimate.

Derivation

Members

Defined in TLocality:

Inherited from TCoordinate:


Construction and destruction


TLocality()

IMPORT_C TLocality();

Description

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


TLocality(const TCoordinate &,TReal32)

IMPORT_C TLocality(const TCoordinate &aCoordinate, TReal32 aHorizontalAccuracy);

Description

Constructor for TLocality. Allows the client to set a coordinate and a 'surface' accuracy.

Parameters

const TCoordinate &aCoordinate

specifies an initial value for the coordinate.

TReal32 aHorizontalAccuracy

specifies an initial value for the horizontal accuracy.

Panic codes

aHorizontalAccuracy

is negative and not set to NaN.


TLocality(const TCoordinate &,TReal32,TReal32)

IMPORT_C TLocality(const TCoordinate &aCoordinate, TReal32 aHorizontalAccuracy, TReal32 aVerticalAccuracy);

Description

Constructor for TLocality. Allows the client to set a coordinate and both a horizontal and vertical accuracy.

Parameters

const TCoordinate &aCoordinate

specifies an initial value for the coordinate.

TReal32 aHorizontalAccuracy

specifies an initial value for the horizontal (earth-surface) accuracy.

TReal32 aVerticalAccuracy

specifies an initial value for the vertical (altitudinal) accuracy.

Panic codes

aHorizontalAccuracy

or aVerticalAccuracy are negative and not set to NaN.

[Top]


Member functions


SetHorizontalAccuracy(TReal32)

IMPORT_C void SetHorizontalAccuracy(TReal32 aHorizontalAccuracy);

Description

Sets the horizontal accuracy of this coordinate.

Parameters

TReal32 aHorizontalAccuracy

is the new horizontal accuracy, in metres.

Panic codes

aHorizontalAccuracy

is negative and not set to NaN.


SetVerticalAccuracy(TReal32)

IMPORT_C void SetVerticalAccuracy(TReal32 aVerticalAccuracy);

Description

Sets the vertical accuracy of this coordinate.

Parameters

TReal32 aVerticalAccuracy

is the new vertical accuracy, in metres.

Panic codes

aVerticalAccuracy

is negative and not set to NaN.


SetAccuracy(TReal32,TReal32)

IMPORT_C void SetAccuracy(TReal32 aHorizontalAccuracy, TReal32 aVerticalAccuracy);

Description

Sets both the horizontal and vertical accuracy of this coordinate.

Parameters

TReal32 aHorizontalAccuracy

is the new horizontal accuracy, in metres.

TReal32 aVerticalAccuracy

is the new vertical accuracy, in metres.

Panic codes

aHorizontalAccuracy

or aVerticalAccuracy are negative and not set to NaN.


HorizontalAccuracy()const

IMPORT_C TReal32 HorizontalAccuracy() const;

Description

Retrieves the horizontal accuracy of this coordinate.

Return value

TReal32

the horizontal accuracy, in metres.


VerticalAccuracy()const

IMPORT_C TReal32 VerticalAccuracy() const;

Description

Retrieves the vertical accuracy of this coordinate.

Return value

TReal32

the vertical accuracy, in metres.


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.


Distance(const TLocality &,TReal32 &,TReal32 &)const

IMPORT_C TInt Distance(const TLocality &aLocality, TReal32 &aDistance, TReal32 &aDelta) const;

Description

This method calculates the distance between this locality and the supplied locality. An estimate of the accuracy of the result is also provided.

Parameters

const TLocality &aLocality

is another point to use in the calculation.

TReal32 &aDistance

upon successful completion, this is set to the distance between this locality and aLocality, in metres.

TReal32 &aDelta

upon successful completion, this is set to the estimated accuracy of the distance calculation, in metres.

Return value

TInt

a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aLocality.iLatitude or aLocality.iLongitude are set to NaN. KErrArgument if any of iHorizontalAccuracy or aLocality.iHorizontalAccuracy 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.


BearingTo(const TLocality &,TReal32 &,TReal32 &)const

IMPORT_C TInt BearingTo(const TLocality &aTargetLocality, TReal32 &aBearing, TReal32 &aDelta) const;

Description

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

Parameters

const TLocality &aTargetLocality

is the supplied target locality.

TReal32 &aBearing

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

TReal32 &aDelta

upon successful completion, this is set to an estimate of the accuracy of the calculation, in degrees relative to aBearing.

Return value

TInt

a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aTargetLocality.iLatitude or aTargetLocality.iLongitude are set to NaN. KErrArgument if any of iHorizontalAccuracy or aTargetLocality.iHorizontalAccuracy are set to NaN. KErrPositionIncalculable if the error circle (horizontal accuracy) of this locality includes a pole. KErrPositionIncalculable if the two localities has overlapping error circles. KErrPositionIncalculable if the error circle of this locality overlaps with the error circle of aTargetLocality when projected antipodal.

[Top]


Member data


iHorizontalAccuracy

protected: TReal32 iHorizontalAccuracy;

Description

Horizontal (earths-surface) accuracy, in metres.


iVerticalAccuracy

protected: TReal32 iVerticalAccuracy;

Description

Altitudinal accuracy, in metres.