QGeoPositionInfo

The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time. More

Inheritance diagram of PySide6.QtPositioning.QGeoPositionInfo

Synopsis

Functions

Detailed Description

A QGeoPositionInfo contains, at a minimum, a geographical coordinate and a timestamp. It may also have heading and speed measurements as well as estimates of the accuracy of the provided data.

class PySide6.QtPositioning.QGeoPositionInfo

PySide6.QtPositioning.QGeoPositionInfo(coordinate, updateTime)

PySide6.QtPositioning.QGeoPositionInfo(other)

Parameters

Creates an invalid QGeoPositionInfo object.

See also

isValid()

Creates a QGeoPositionInfo for the given coordinate and timestamp.

Creates a QGeoPositionInfo with the values of other.

PySide6.QtPositioning.QGeoPositionInfo.Attribute

Defines the attributes for positional information.

Constant

Description

QGeoPositionInfo.Direction

The bearing measured in degrees clockwise from true north to the direction of travel.

QGeoPositionInfo.GroundSpeed

The ground speed, in meters/sec.

QGeoPositionInfo.VerticalSpeed

The vertical speed, in meters/sec.

QGeoPositionInfo.MagneticVariation

The angle between the horizontal component of the magnetic field and true north, in degrees. Also known as magnetic declination. A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction.

QGeoPositionInfo.HorizontalAccuracy

The accuracy of the provided latitude-longitude value, in meters.

QGeoPositionInfo.VerticalAccuracy

The accuracy of the provided altitude value, in meters.

NMEA protocol also suggests another type of accuracy - PositionAccuracy, which is a 3D accuracy value. Qt does not provide a separate attribute for it. If you need this value, you can calculate it based on the following formula:

PositionAccuracy 2 = HorizontalAccuracy 2 + VerticalAccuracy 2

PySide6.QtPositioning.QGeoPositionInfo.attribute(attribute)
Parameters

attributeAttribute

Return type

float

Returns the value of the specified attribute as a qreal value.

Returns NaN if the value has not been set.

The function hasAttribute() should be used to determine whether or not a value has been set for an attribute.

PySide6.QtPositioning.QGeoPositionInfo.coordinate()
Return type

PySide6.QtPositioning.QGeoCoordinate

Returns the coordinate for this position.

Returns an invalid coordinate if no coordinate has been set.

See also

setCoordinate()

PySide6.QtPositioning.QGeoPositionInfo.hasAttribute(attribute)
Parameters

attributeAttribute

Return type

bool

Returns true if the specified attribute is present for this QGeoPositionInfo object.

PySide6.QtPositioning.QGeoPositionInfo.isValid()
Return type

bool

Returns true if the timestamp() and coordinate() values are both valid.

See also

isValid() isValid()

PySide6.QtPositioning.QGeoPositionInfo.__ne__(rhs)
Parameters

rhsPySide6.QtPositioning.QGeoPositionInfo

Return type

bool

PySide6.QtPositioning.QGeoPositionInfo.__eq__(rhs)
Parameters

rhsPySide6.QtPositioning.QGeoPositionInfo

Return type

bool

PySide6.QtPositioning.QGeoPositionInfo.removeAttribute(attribute)
Parameters

attributeAttribute

Removes the specified attribute and its value.

PySide6.QtPositioning.QGeoPositionInfo.setAttribute(attribute, value)
Parameters

Sets the value for attribute to value.

See also

attribute()

PySide6.QtPositioning.QGeoPositionInfo.setCoordinate(coordinate)
Parameters

coordinatePySide6.QtPositioning.QGeoCoordinate

Sets the coordinate for this position to coordinate.

See also

coordinate()

PySide6.QtPositioning.QGeoPositionInfo.setTimestamp(timestamp)
Parameters

timestampPySide6.QtCore.QDateTime

Sets the date and time at which this position was reported to timestamp.

The timestamp must be in UTC time.

See also

timestamp()

PySide6.QtPositioning.QGeoPositionInfo.swap(other)
Parameters

otherPySide6.QtPositioning.QGeoPositionInfo

PySide6.QtPositioning.QGeoPositionInfo.timestamp()
Return type

PySide6.QtCore.QDateTime

Returns the date and time at which this position was reported, in UTC time.

Returns an invalid QDateTime if no date/time value has been set.

See also

setTimestamp()