»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Location Based Services LOCATIONFRAMEWORK »
TLocality
Location:
LbsPosition.h
Link against: lbsselflocate.lib
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
TCoordinate
- TCoordinate is used to hold the basic coordinates of a location (latitude, longitude and altitude)
TLocality
- Adds an error estimate for the horizontal and vertical accuracy of the point to
TCoordinate
Members
Defined in TLocality
:
BearingTo()
, BearingTo()
, Distance()
, Distance()
, HorizontalAccuracy()
, SetAccuracy()
, SetHorizontalAccuracy()
, SetVerticalAccuracy()
, TLocality()
, TLocality()
, TLocality()
, VerticalAccuracy()
, iHorizontalAccuracy
, iVerticalAccuracy
Inherited from TCoordinate
:
Altitude()
,
Datum()
,
Latitude()
,
Longitude()
,
Move()
,
SetCoordinate()
,
SetDatum()
,
iAltitude
,
iDatum
,
iLatitude
,
iLongitude
,
iReserved
Construction and destruction
IMPORT_C TLocality();
Description
Default constructor for TLocality. Sets the member data to default values (NaN).
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
IMPORT_C TReal32 HorizontalAccuracy() const;
Description
Retrieves the horizontal accuracy of this coordinate.
Return value
TReal32
|
the horizontal accuracy, in metres.
|
|
IMPORT_C TReal32 VerticalAccuracy() const;
Description
Retrieves the vertical accuracy of this coordinate.
Return value
TReal32
|
the vertical accuracy, in metres.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
protected: TReal32 iHorizontalAccuracy;
Description
Horizontal (earths-surface) accuracy, in metres.
protected: TReal32 iVerticalAccuracy;
Description
Altitudinal accuracy, in metres.