ArcGIS for Developers

Position QML Type

Holds positional data at a particular point in time. More...

Import Statement: import ArcGIS.AppFramework.Positioning 1.0

Properties

Signals

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

accuracyType : PositionInfo::AccuracyType

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.


[read-only] accuracyTypeValid : bool

Returns true if the value of the accuracyType property is valid. Otherwise, returns false.


altitudeError : double

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.


[read-only] altitudeErrorValid : bool

True if the altitudeError property is valid. Otherwise, returns false.


[read-only] altitudeValid : bool

Returns true if the altitude value has been set. Otherwise, returns false.


coordinate : QGeoCoordinate

Returns the latitude, longitude, and altitude value of the position.


differentialAge : double

Returns the age, in seconds, of the differential signal and correction used by the GPS receiver to differentially correct the position.


[read-only] differentialAgeValid : bool

Returns true if the differentialAge property has been set. Otherwise, returns false.


direction : double

Returns the direction of travel, in degrees from true north.


[read-only] directionValid : bool

Returns true if the direction property has been set. Otherwise, returns false.


fixType : PositionInfo::FixType

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).


[read-only] fixTypeValid : bool

Returns true if the fixType property has been set. Otherwise, returns false.


geoidSeparation : double

Returns the difference between the WGS-84 earth ellipsoid and mean sea level. Also sometimes referred to as orthometric height.


[read-only] geoidSeparationValid : bool

Returns true if the geoidSeparation value has been set. Otherwise, returns false.


hdop : double

Returns the positional data's HDOP (Horizontal Dilution of Precision).


[read-only] hdopValid : bool

Returns true if the hdop value has been set. Otherwise, returns false.


horizontalAccuracy : double

Returns the horizontal accuracy of the coordinate, in meters.


[read-only] horizontalAccuracyValid : bool

Returns true if the horizontalAccuracy property has been set. Otherwise, returns false.


[read-only] json : object


latitudeError : double

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.


[read-only] latitudeErrorValid : bool

Returns true if the latitudeError property is valid. Otherwise, returns false.


[read-only] latitudeValid : bool

Returns true if the latitude value has been set. Otherwise, returns false.


longitudeError : double

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.


[read-only] longitudeErrorValid : bool

Returns true if the longitudeError property is valid. Otherwise, returns false.


[read-only] longitudeValid : bool

Returns true if the longitude value has been set. Otherwise, returns false.


magneticVariation : double

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.


[read-only] magneticVariationValid : bool

Returns true if the magnetic variation value has been set. Otherwise, returns false.


pdop : double

Returns the positional data's PDOP (Position Dilution of Precision). The equation used to determine PDOP is PDOP^2 = HDOP^2 + VDOP^2.


[read-only] pdopValid : bool

Returns true if the pdop property has been set. Otherwise, returns false.


positionAccuracy : double

Returns the mean radial spherical error. Encompasses both horizontal and vertical error.


[read-only] positionAccuracyValid : bool

Returns true if the positionAccuracy value has been set. Otherwise, returns false.


referenceStationId : int

Returns the differential reference station ID (DSID) of the station used by the GPS receiver.


[read-only] referenceStationIdValid : bool

Returns true if the referenceStationId property has been set. Otherwise, returns false.


satellitesInUse : int

Returns the amount of positioning satellites being used to return the position data.


[read-only] satellitesInUseValid : bool

Returns true if the satellitesInUse property has been set. Otherwise, returns false.


satellitesVisible : int

Returns the amount of positioning satellites visible at the time of location capture.


[read-only] satellitesVisibleValid : bool

Returns true if the satellitesValid property has been set. Otherwise, returns false.


speed : double

Returns the value of speed, measured as meters per second.


[read-only] speedValid : bool

Returns true if the speed property has been set.


timestamp : time

Returns the timestamp when this position was received.


vdop : double

Returns the positional data's VDOP (Vertical Dilution of Precision).


[read-only] vdopValid : bool

Returns true if the vdop property has been set. Otherwise, returns false.


verticalAccuracy : double

Returns the vertical accuracy of the coordinate, in meters.


[read-only] verticalAccuracyValid : bool

Returns true if the verticalAccuracy property has been set. Otherwise, returns false.


verticalSpeed : double

Returns the value of the vertical speed, in meters per second.


[read-only] verticalSpeedValid : bool

Returns true if the verticalSpeed value has been set. Otherwise, returns false.


Signal Documentation

directionChanged()

Signal emitted when the direction property changes.


directionValidChanged()

Signal emitted when the directionValid property has changed.


magneticVariationChanged()

Signal emitted when the magneticVariation value has changed.


magneticVariationValidChanged()

Signal emitted when the magneticVariationValid property changes.


verticalSpeedChanged()

Signal emitted when the verticalSpeed property has changed.


verticalSpeedValidChanged()

Signal emitted when the verticalSpeedValid property has changed.