TLocality Class Reference

#include <lbsposition.h>

Link against: lbs.lib

class TLocality : public TCoordinate

Inherits from

Detailed 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.

Member Attribute Documentation

iHorizontalAccuracy

TReal32 iHorizontalAccuracy[protected]

Horizontal (earths-surface) accuracy, in metres.

iVerticalAccuracy

TReal32 iVerticalAccuracy[protected]

Altitudinal accuracy, in metres.

Constructor & Destructor Documentation

TLocality ( )

IMPORT_CTLocality()

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

TLocality ( const TCoordinate &, TReal32 )

IMPORT_CTLocality(const TCoordinate &aCoordinate,
TReal32aHorizontalAccuracy
)

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

Parameters
aCoordinatespecifies an initial value for the coordinate.
aHorizontalAccuracyspecifies an initial value for the horizontal accuracy.
Panic Codes
aHorizontalAccuracyis negative and not set to NaN.

TLocality ( const TCoordinate &, TReal32, TReal32 )

IMPORT_CTLocality(const TCoordinate &aCoordinate,
TReal32aHorizontalAccuracy,
TReal32aVerticalAccuracy
)

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

Parameters
aCoordinatespecifies an initial value for the coordinate.
aHorizontalAccuracyspecifies an initial value for the horizontal (earth-surface) accuracy.
aVerticalAccuracyspecifies an initial value for the vertical (altitudinal) accuracy.
Panic Codes
aHorizontalAccuracyor aVerticalAccuracy are negative and not set to NaN.

Member Function Documentation

BearingTo ( const TCoordinate &, TReal32 & )

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

Reimplemented from TCoordinate::BearingTo(const TCoordinate &,TReal32 &)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.

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

IMPORT_C TIntBearingTo(const TLocality &aTargetLocality,
TReal32 &aBearing,
TReal32 &aDelta
)const

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

Parameters
aTargetLocalityis the supplied target locality.
aBearingupon successful completion, this is set to the bearing from this locality to aTargetLocality, in degrees counting clockwise relative to true north.
aDeltaupon successful completion, this is set to an estimate of the accuracy of the calculation, in degrees relative to aBearing.
Return Value
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.

Distance ( const TCoordinate &, TReal32 & )

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

Reimplemented from TCoordinate::Distance(const TCoordinate &,TReal32 &)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.

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

IMPORT_C TIntDistance(const TLocality &aLocality,
TReal32 &aDistance,
TReal32 &aDelta
)const

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

Parameters
aLocalityis another point to use in the calculation.
aDistanceupon successful completion, this is set to the distance between this locality and aLocality, in metres.
aDeltaupon successful completion, this is set to the estimated accuracy of the distance calculation, in metres.
Return Value
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.

HorizontalAccuracy ( )

IMPORT_C TReal32HorizontalAccuracy()const

Retrieves the horizontal accuracy of this coordinate.

Return Value
the horizontal accuracy, in metres.

SetAccuracy ( TReal32, TReal32 )

IMPORT_C voidSetAccuracy(TReal32aHorizontalAccuracy,
TReal32aVerticalAccuracy
)

Sets both the horizontal and vertical accuracy of this coordinate.

Parameters
aHorizontalAccuracyis the new horizontal accuracy, in metres.
aVerticalAccuracyis the new vertical accuracy, in metres.
Panic Codes
aHorizontalAccuracyor aVerticalAccuracy are negative and not set to NaN.

SetHorizontalAccuracy ( TReal32 )

IMPORT_C voidSetHorizontalAccuracy(TReal32aHorizontalAccuracy)

Sets the horizontal accuracy of this coordinate.

Parameters
aHorizontalAccuracyis the new horizontal accuracy, in metres.
Panic Codes
aHorizontalAccuracyis negative and not set to NaN.

SetVerticalAccuracy ( TReal32 )

IMPORT_C voidSetVerticalAccuracy(TReal32aVerticalAccuracy)

Sets the vertical accuracy of this coordinate.

Parameters
aVerticalAccuracyis the new vertical accuracy, in metres.
Panic Codes
aVerticalAccuracyis negative and not set to NaN.

VerticalAccuracy ( )

IMPORT_C TReal32VerticalAccuracy()const

Retrieves the vertical accuracy of this coordinate.

Return Value
the vertical accuracy, in metres.