Position data and info classes

This document describes the basic and extended classes that hold position data.

The Location Acquisition API defines a set of position data classes. Some of these classes store the co-ordinates of a location fix and others store information about course and positioning satellites. The API also defines position info classes that wrap the position data classes. These classes are used to pass data across the Location Acquisition API. Figure 1 illustrates the position data and position info classes with some of the most important methods.

Figure 1. Figure 1 Position data and info classes

The position data classes

  • TCoordinate is the base class for all the position data classes. It holds latitude, longitude and altitude data. All positioning modules must provide latitude and longitude information, but not all modules are guaranteed to provide altitude information.

  • TLocality adds accuracy information to co-ordinates.

  • TPosition adds the time at which the location fix was obtained and also allows the average speed between two positions to be calculated.

There are two additional position data classes that are not part of this position data class inheritance hierarchy.

  • TCourse holds bearing and current speed data.

  • TSatelliteData holds information on one of the satellites used to obtain the location fix.

Note that it is a position info object and not a position data object that is passed across the Location Acquisition API. Client applications extract the position data object from the wrapper position info object.

See Position data for a description of how the location data is represented inside the position data classes.

The position info classes

Client applications use three position info classes that wrap the position data classes:

To get location information, a reference to an object of a class derived from TPositionInfoBase is passed in a call to RPositioner::NotifyPositionUpdate() or RPositioner::GetLastKnownPosition(). The position info class hierarchy allows simple location information (TPositionInfo), course information (TCourse Info) or satellite information (TSatelliteInfo) to be obtained via the same calls to the Location Acquisition API.

HPositionGenericInfo

HPositionGenericInfo is an extended position info class that allocates memory on the heap. Applications can use the class to retrieve additional position information from positioning hardware that can provide it (such as NMEA strings provided by Bluetooth GPS hardware).

HPositionGenericInfo is only supported by the Location Server eposserver.exe. It can only be used by applications that link with lbs.lib. Not all PSYs support this class.

See also

Position data