Positions¶
The UnlPositionData and ImprovedPostionData classes provide a comprehensive representation of geographical and movement data for GPS-based systems. They include details like coordinates, speed, altitude, direction, and accuracy, along with road-related metadata such as speed limits and modifiers. With robust support for position quality assessment and timestamped data, it is well-suited for navigation and sensor-driven applications.
π‘ Tip
Do not confuse
UnlCoordinateswithPosition. TheUnlCoordinatesclass represents a geographic location using latitude, longitude, and altitude, and is used widely throughout the SDK. In contrast,UnlPositionDataandImprovedPostionDatacarry additional sensor data and are primarily used to represent the user's current location and movement.
Instantiating Positionsβ¶
The UnlPositionData class can be instantiated using the provided methods within the SenseDataFactory class. Additionally, it can be accessed through the methods exposed by the Navigation SDK for Android. For more details, refer to the Get Started with Positioning guide.
Raw position dataβ¶
Raw position data represents unprocessed data from the GPS sensors of devices. It provides basic information. It corresponds to the UnlPositionData interface.
Map matched position dataβ¶
Map matching is a method in location-based services that aligns raw GPS data with a digital map, correcting inaccuracies by snapping the position to the nearest logical location, such as roads. It corresponds with the ImprovedPostionData interface.
Raw position data vs map matched position dataβ¶
The Map Matched positions provide more information, as it can be seen in the table below:
| Attribute | Raw | Map Matched | When is available | Description |
|---|---|---|---|---|
| acquisitionTimestamp | β | β | always | The system time when the data was collected from sensors. |
| satelliteTime | β | β | always | The satellite timestamp when position was collected by the sensors. |
| provider | β | β | always | The provider type (GPS, network, unknown) |
| latitude & longitude | β | β | hasCoordinates | The latitude and longitude at the position in degrees |
| altitude | β | β | hasAltitude | The altitude at the given position. Might be negative |
| speed | β | β | hasSpeed | The current speed (always non-negative) |
| speedAccuracy | β | β | hasSpeedAccuracy | The current speed accuracy (always non-negative). Typical accuracy is 2 m/s in good conditions |
| course | β | β | hasCourse | The current direction of movement in degrees (0 north, 90 east, 180 south, 270 west) |
| courseAccuracy | β | β | hasCourseAccuracy | The current heading accuracy is degrees (typical accuracy is 25 degrees) |
| horizontalAccuracy | β | β | hasHorizontalAccuracy | The horizontal accuracy in meters. Always positive. (typical accuracy 5-20 meters) |
| verticalAccuracy | β | β | hasVerticalAccuracy | The vertical accuracy in meters. Always positive. |
| fixQuality | β | β | always | The accuracy quality (inertial β based on extrapolation, low β inaccurate, high β good accuracy, invalid β unknown) |
| coordinates | β | β | hasCoordinates | The coordinates of the position |
| roadModifier | β | β | hasRoadLocalization | The road modifiers (such as tunnel, bridge, ramp, etc.) |
| roadSpeedLimit | β | β | always | The speed limit on the current road in m/s. It is 0 if no speedLimit information is available |
π Note
The
roadSpeedLimitfield may not always have a value, even if the position is map matched. This can happen if data is unavailable for the current road segment or if the position is not on a road. In such cases, theroadSpeedLimitfield will be set to 0.π‘ Tip
One common use case for
speedandroadSpeedLimitis to check if a user is exceeding the legal speed limit. TheUnlAlarmServiceclass offers a reliable solution for this scenario. Refer to the speed warnings guide for more details.