#include <lbslocation.h>
Public Member Functions | |
IMPORT_C TBool | IsLatLongValid () const |
IMPORT_C TReal64 | Latitude () const |
IMPORT_C TReal64 | Longitude () const |
IMPORT_C TReal32 | Accuracy () const |
IMPORT_C TBool | IsAltitudeValid () const |
IMPORT_C TReal32 | Altitude () const |
IMPORT_C TReal32 | AltitudeAccuracy () const |
IMPORT_C TBool | IsSpeedValid () const |
IMPORT_C TReal32 | Speed () const |
IMPORT_C TReal32 | SpeedAccuracy () const |
IMPORT_C TBool | IsCourseValid () const |
IMPORT_C TReal32 | Course () const |
IMPORT_C TReal32 | CourseAccuracy () const |
IMPORT_C TInt | GetMeanSpeed (const TLbsLocation &aOtherLocation, TReal32 &aMeanSpeed) const |
IMPORT_C TInt | GetDistance (const TLbsLocation &aOtherLocation, TReal32 &aDistance) const |
IMPORT_C TInt | GetBearingTo (const TLbsLocation &aOtherLocation, TReal32 &aBearing) const |
IMPORT_C TInt | Move (TReal32 aBearing, TReal32 aDistance) |
IMPORT_C TTime | SystemTimeStamp () const |
IMPORT_C TInt | SetLocation (TReal64 aLatitude, TReal64 aLongitude, TReal32 aAccuracy) |
IMPORT_C TInt | SetAltitude (TReal32 aAltitude, TReal32 aAccuracy) |
IMPORT_C TInt | SetSpeed (TReal32 aSpeed, TReal32 aAccuracy) |
IMPORT_C TInt | SetCourse (TReal32 aCourse, TReal32 aAccuracy) |
IMPORT_C TInt | SetSystemTimeStamp (TTime aTimeStamp) |
TLbsLocation - Contains a position and its accuracy. May contain altitude, speed and course. See .cpp file for extended comments.
EXPORT_C TReal32 TLbsLocation::Accuracy | ( | ) | const |
Retrieves the horizontal (circular) accuracy of the latitude and longitude in meters.
If the accuracy has not been assigned the method returns zero.
Applications should use IsLatLongValid() to determine if there is a valid accuracy.
EXPORT_C TReal32 TLbsLocation::Altitude | ( | ) | const |
Retrieves the altitude in meters for the location.
If the altitude is not available the method returns zero. Availability of altitude information is dependent on the underlying positioning technology and will not always be present.
Applications should use IsAltitudeValid() to determine if there is a valid altitude.
EXPORT_C TReal32 TLbsLocation::AltitudeAccuracy | ( | ) | const |
Retrieves the vertical accuracy of the location.
If the altitude is not available the method returns zero. Availability of altitude information is dependent on the underlying positioning technology and will not always be present.
Applications should use IsAltitudeValid() to determine if there is a valid altitude.
EXPORT_C TReal32 TLbsLocation::Course | ( | ) | const |
Retrieves the course in degrees counting clockwise relative to true north.
If the course is not available, the method returns zero.
Availability of course information is dependent on the underlying positioning technology and will not always be present. Even satellite based technologies may not provide course information in certain circumstances.
Applications should use IsCourseValid() to determine if there is a valid course.
When there is a valid course, the range of values will be from [0 to 360). That is: values can be up to (but will not include) 360. A value of 0 indicates the device is heading north.
EXPORT_C TReal32 TLbsLocation::CourseAccuracy | ( | ) | const |
Retrieves the accuracy of the course information in degrees.
If the course is not available the method returns zero.
Availability of course information is dependent on the underlying positioning technology and will not always be present.
Applications should use IsCourseValid() to determine if there is a valid course.
When course information is available, the accuracy indicates the size of the error band. The actual course may be vary from the reported course but the difference should be less than or equal to the course accuracy.
EXPORT_C TInt TLbsLocation::GetBearingTo | ( | const TLbsLocation & | aOtherLocation, | |
TReal32 & | aBearing | |||
) | const |
Calculate the bearing in degrees from this location to the supplied location.
[in] | aOtherLocation | Target location. |
[out] | aBearing | Upon successful completion, this is set to the bearing from this location to aOtherLocation. Value is in degrees counting clockwise relative to true north. |
EXPORT_C TInt TLbsLocation::GetDistance | ( | const TLbsLocation & | aOtherLocation, | |
TReal32 & | aDistance | |||
) | const |
Calculate the distance between this location and the supplied location.
[in] | aOtherLocation | A point different from this Location. |
[out] | aDistance | Upon successful completion, this is set to the distance between this location and aOtherLocation, in meters. |
EXPORT_C TInt TLbsLocation::GetMeanSpeed | ( | const TLbsLocation & | aOtherLocation, | |
TReal32 & | aMeanSpeed | |||
) | const |
This method calculates the mean horizontal speed in meters per second between this location and the supplied aOtherLocation. The speed is calculated based on the latitude and longitude of each of the locations and their system timestamps.
[in] | aOtherLocation | A point different from this Location. |
[out] | aMeanSpeed | Upon successful completion, this is set to the speed indicated by being at this position at its recorded time, and at aOtherLocation at its recorded time. Always positive, in meters per second. |
EXPORT_C TBool TLbsLocation::IsAltitudeValid | ( | ) | const |
Determines if an altitude has been assigned.
Availability of altitude information is dependent on the underlying positioning technology and will not always be present.
EXPORT_C TBool TLbsLocation::IsCourseValid | ( | ) | const |
Determines if a valid course is available.
Availability of course information is dependent on the underlying positioning technology and will not always be present. Even satellite based technologies may not provide course information in certain circumstances.
EXPORT_C TBool TLbsLocation::IsLatLongValid | ( | ) | const |
Determines if a latitude and longitude and (horizontal) accuracy has been assigned.
Positions returned by the location subsystem will have a valid latitude, longitude and accuracy.
When applications create their own instances of the TLbsLocation class this method will return EFalse until a latitude and longitude has been assigned.
EXPORT_C TBool TLbsLocation::IsSpeedValid | ( | ) | const |
Determines if a valid speed is available.
Availability of speed information is dependent on the underlying positioning technology and will not always be present. Even satellite based technologies may not provide speed information in certain circumstances.
EXPORT_C TReal64 TLbsLocation::Latitude | ( | ) | const |
Retrieves the latitude of the location. Coordinates are referenced to WGS84 datum.
If the latitude has not been assigned the method returns zero.
Applications should use IsLatLongValid() to determine if there is a valid latitude.
EXPORT_C TReal64 TLbsLocation::Longitude | ( | ) | const |
Retrieves the longitude of the location. Coordinates are referenced to WGS84 datum.
If the longitude has not been assigned the method returns zero.
Applications should use IsLatLongValid() to determine if there is a valid longitude.
EXPORT_C TInt TLbsLocation::Move | ( | TReal32 | aBearing, | |
TReal32 | aDistance | |||
) |
This method moves this location aDistance in the direction specified by aBearing
[in] | aBearing | The direction to move this location. Value is in degrees counting clockwise relative to true north. |
[in] | aDistance | The distance to move this Location. Value is in meters. |
EXPORT_C TInt TLbsLocation::SetAltitude | ( | TReal32 | aAltitude, | |
TReal32 | aAccuracy | |||
) |
Sets the altitude information for the location.
After the altitude has been successfully assigned, the method IsAltitudeValid will return ETrue.
[in] | aAltitude | The altitude of the location in meters. |
[in] | aAccuracy | The accuracy of the course in degrees. Value cannot be negative |
EXPORT_C TInt TLbsLocation::SetCourse | ( | TReal32 | aCourse, | |
TReal32 | aAccuracy | |||
) |
Sets the course information for the location.
If the course paramater is outside the range [0,360) it will be automatically adjusted to fall within the valid range. For example, attempting to set a course 361 degrees will be converted to 1 degree.
After the course has been successfully assigned, the method IsCourseValid() will return ETrue.
[in] | aCourse | Degrees counting clockwise relative to true north. Normal range is 0 up to (but not including) 360. |
[in] | aAccuracy | The accuracy of the course in degrees. Value cannot be negative |
EXPORT_C TInt TLbsLocation::SetLocation | ( | TReal64 | aLatitude, | |
TReal64 | aLongitude, | |||
TReal32 | aAccuracy | |||
) |
Sets the position information for the location.
If the latitude and longitude paramaters are outside the range [-90,+90], [0,360) the position will be automatically adjusted to fall within the valid range. For example, attempting to set a position of latitude 91, longitude 0 will be converted into 89, 180, respectively.
After these parameters have been successfully assigned, the method IsLatLongValid() will return ETrue.
[in] | aLatitude | The latitude of the location in degrees. Normal range is 0 up to (but not including) 360 degrees. |
[in] | aLongitude | The longitude of the location in degrees. Normal range is -90 to +90 (inclusive). |
[in] | aAccuracy | The accuracy of the course in degrees. Value cannot be negative |
EXPORT_C TInt TLbsLocation::SetSpeed | ( | TReal32 | aSpeed, | |
TReal32 | aAccuracy | |||
) |
Sets the speed information for the location.
After the speed has been successfully assigned, the method IsSpeedValid() will return ETrue.
[in] | aSpeed | The speed that is related to the location in meters per second. Value cannot be negative. |
[in] | aAccuracy | The accuracy of the speed in meters per second. Value cannot be negative. |
EXPORT_C TInt TLbsLocation::SetSystemTimeStamp | ( | TTime | aTimeStamp | ) |
Sets the system time stamp for the location information.
This is the time when the location information entered the system.
The parameter aTimeStamp must contain a valid time and cannot be "zero".
[in] | aTimeStamp | The system time that is related to the location information. |
EXPORT_C TReal32 TLbsLocation::Speed | ( | ) | const |
Retrieves the speed in meters per second.
If the speed is not available the method returns zero.
Availability of speed information is dependent on the underlying positioning technology and will not always be present. Even satellite based technologies may not provide speed information in certain circumstances.
Applications should use IsSpeedValid() to determine if there is a valid speed.
EXPORT_C TReal32 TLbsLocation::SpeedAccuracy | ( | ) | const |
Retrieves the accuracy of the speed information in meters per second.
If the speed is not available the method returns zero.
Availability of speed information is dependent on the underlying positioning technology and will not always be present.
When speed information is available, the accuracy indicates the size of the error band. The actual speed may be above or below the reported speed but the difference should be less than or equal to the speed accuracy.
Applications should use IsSpeedValid() to determine if there is a valid speed.
EXPORT_C TTime TLbsLocation::SystemTimeStamp | ( | ) | const |
Retrieves the time on the device when the location entered the system.
If this time stamp has not been assigned, a TTime of "zero" will be returned.
This timestamp is assigned by the local device and reflects when the location information injected. In particular, this timestamp does not provide technology specific information such as GPS time.