Holds positional data at a particular point in time. More...
Import Statement: | import ArcGIS.AppFramework.Positioning 1.0 |
Properties
- accuracyType : PositionInfo::AccuracyType
- accuracyTypeValid : bool
- altitudeError : double
- altitudeErrorValid : bool
- altitudeValid : bool
- coordinate : QGeoCoordinate
- differentialAge : double
- differentialAgeValid : bool
- direction : double
- directionValid : bool
- fixType : PositionInfo::FixType
- fixTypeValid : bool
- geoidSeparation : double
- geoidSeparationValid : bool
- hdop : double
- hdopValid : bool
- horizontalAccuracy : double
- horizontalAccuracyValid : bool
- json : object
- latitudeError : double
- latitudeErrorValid : bool
- latitudeValid : bool
- longitudeError : double
- longitudeErrorValid : bool
- longitudeValid : bool
- magneticVariation : double
- magneticVariationValid : bool
- pdop : double
- pdopValid : bool
- positionAccuracy : double
- positionAccuracyValid : bool
- referenceStationId : int
- referenceStationIdValid : bool
- satellitesInUse : int
- satellitesInUseValid : bool
- satellitesVisible : int
- satellitesVisibleValid : bool
- speed : double
- speedValid : bool
- timestamp : time
- vdop : double
- vdopValid : bool
- verticalAccuracy : double
- verticalAccuracyValid : bool
- verticalSpeed : double
- verticalSpeedValid : bool
Signals
- directionChanged()
- directionValidChanged()
- magneticVariationChanged()
- magneticVariationValidChanged()
- verticalSpeedChanged()
- verticalSpeedValidChanged()
Detailed Description
The Position component holds values related to current device location such as coordinate (longitude, latitude, and altitude), dilution of precision (HDOP, PDOP, VDOP), speed over ground, true course over ground, and time.
To use the Position component, you first need to search and connect to a device using DeviceDiscoveryAgent. You must then provide NmeaSource and PositionSource to get values related to the current device location, which the Position component holds.
The following code sample demonstrates the use of the Position component to get and provide a series of locational properties from a device found by DeviceDiscoveryAgent.
Item { property DeviceListModel deviceListModel: discoveryAgent.devices property Device currentDevice property Position currentPosition ColumnLayout { anchors.fill: parent anchors.margins: 10 ComboBox { id: comboBox Layout.fillWidth: true model: deviceListModel textRole: "name" onCurrentTextChanged: selectDevice(deviceListModel.get(currentIndex)) } ListView { id: listView property var fields: [ "latitude", "longitude", "altitude", "timestamp", "speed", "horizontalAccuracy", "verticalAccuracy", "direction", "verticalSpeed", "magneticVariation", "hdop", "pdop", "gdop", "vdop", "fixType", "differentialAge", "referenceStationId", "satellitesVisible", "satellitesInUse", "positionAccuracy", "geoidSeparation" ] Layout.fillWidth: true Layout.fillHeight: true model: currentPosition != null ? fields : 0 delegate: Text { text: "%1: %2".arg(modelData).arg(getPositionValue(modelData)) } } } DeviceDiscoveryAgent { id: discoveryAgent } NmeaSource { id: nmeaSource } PositionSource { id: positionSource active: false nmeaSource: nmeaSource onPositionChanged: currentPosition = position } Connections { target: deviceListModel onCountChanged: if (comboBox.currentIndex == -1 && deviceListModel.count > 0) { comboBox.currentIndex = 0; } } function selectDevice(device) { positionSource.active = false; currentDevice = device; nmeaSource.source = currentDevice; positionSource.active = true; } function getPositionValue(key) { var nan = "NaN"; if (!currentPosition) return nan; if (!currentPosition[key + "Valid"]) return nan; return currentPosition.coordinate[key] || currentPosition[key]; } Component.onCompleted: discoveryAgent.start() }
Property Documentation
Indicates the type of accuracy reported by the horizontalAccuracy and verticalAccuracy properties.
RMS is root mean square accuracy. This is calculated based on the 1-sigma latitude, longitude, and altitude errors reported in the GST sentence provided by the receiver. If the receiver does not support GST, DOP is used instead.
DOP is dilution of precision based accuracy. This uses a constant UERE (User Estimated Range Error) value to estimate horizontal and vertical accuracies.
Returns true if the value of the accuracyType property is valid. Otherwise, returns false.
Holds the value of altitude 1-sigma error, in meters. This property will only be populated if your positioning device supports GST sentences in NMEA streams.
True if the altitudeError property is valid. Otherwise, returns false.
Returns true if the altitude value has been set. Otherwise, returns false.
Returns the age, in seconds, of the differential signal and correction used by the GPS receiver to differentially correct the position.
Returns true if the differentialAge property has been set. Otherwise, returns false.
Returns true if the direction property has been set. Otherwise, returns false.
Returns the type of position fix the coordinate has. Potential results are NoFix (0), GPS (1), DifferentialGPS (2), PrecisePositioningService (3), RTKFixed (4), RTKFloat (5), Estimated (6), Manual (7), Simulator (8), and SBAS (9).
Returns true if the fixType property has been set. Otherwise, returns false.
Returns the difference between the WGS-84 earth ellipsoid and mean sea level. Also sometimes referred to as orthometric height.
Returns true if the geoidSeparation value has been set. Otherwise, returns false.
Returns true if the horizontalAccuracy property has been set. Otherwise, returns false.
Holds the value of latitude 1-sigma error, in meters. This property will only be populated if your positioning device supports GST sentences in NMEA streams.
Returns true if the latitudeError property is valid. Otherwise, returns false.
Returns true if the latitude value has been set. Otherwise, returns false.
Holds the value of longitude 1-sigma error, in meters. This property will only be populated if your positioning device supports GST sentences in NMEA streams.
Returns true if the longitudeError property is valid. Otherwise, returns false.
Returns true if the longitude value has been set. Otherwise, returns false.
Returns the angle between the horizontal component of the magnetic field and true north, in degrees. A positive value indicates a clockwise direction from true north, while a negative value indicates a counter-clockwise.
Returns true if the magnetic variation value has been set. Otherwise, returns false.
Returns the positional data's PDOP (Position Dilution of Precision). The equation used to determine PDOP is PDOP^2 = HDOP^2 + VDOP^2.
Returns true if the pdop property has been set. Otherwise, returns false.
Returns the mean radial spherical error. Encompasses both horizontal and vertical error.
Returns true if the positionAccuracy value has been set. Otherwise, returns false.
Returns the differential reference station ID (DSID) of the station used by the GPS receiver.
Returns true if the referenceStationId property has been set. Otherwise, returns false.
Returns the amount of positioning satellites being used to return the position data.
Returns true if the satellitesInUse property has been set. Otherwise, returns false.
Returns the amount of positioning satellites visible at the time of location capture.
Returns true if the satellitesValid property has been set. Otherwise, returns false.
Returns true if the vdop property has been set. Otherwise, returns false.
Returns true if the verticalAccuracy property has been set. Otherwise, returns false.
Returns true if the verticalSpeed value has been set. Otherwise, returns false.
Signal Documentation
Signal emitted when the direction property changes.
Note: The corresponding handler is onDirectionChanged
.
Signal emitted when the directionValid property has changed.
Note: The corresponding handler is onDirectionValidChanged
.
Signal emitted when the magneticVariation value has changed.
Note: The corresponding handler is onMagneticVariationChanged
.
Signal emitted when the magneticVariationValid property changes.
Note: The corresponding handler is onMagneticVariationValidChanged
.
Signal emitted when the verticalSpeed property has changed.
Note: The corresponding handler is onVerticalSpeedChanged
.
Signal emitted when the verticalSpeedValid property has changed.
Note: The corresponding handler is onVerticalSpeedValidChanged
.