Class: QgsVectorLayerGpsLogger

Handles logging of incoming GPS data to a vector layer.

Added in version 3.30.

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLayerGpsLogger

Base classes

QgsGpsLogger

Base class for objects which log incoming GPS data.

QObject

Methods

destinationField

Returns the destination field name for a specific GPS information component.

endCurrentTrack

Ends the current track, storing it in the tracksLayer() if appropriate.

pointsLayer

Returns the layer in which recorded GPS points will be stored.

setDestinationField

Sets a destination field name for a specific GPS information component.

setPointsLayer

Sets the layer in which recorded GPS points should be stored.

setTracksLayer

Sets the layer in which recorded GPS tracks should be stored.

setWriteToEditBuffer

Sets whether the logger will use the vector layer edit buffer for the destination layers.

tracksLayer

Returns the layer in which recorded GPS tracks will be stored.

writeToEditBuffer

Returns True if the logger will use the vector layer edit buffer for the destination layers.

class qgis.core.QgsVectorLayerGpsLogger[source]

Bases: QgsGpsLogger

__init__(connection: QgsGpsConnection | None, parent: QObject | None = None)

Constructor for QgsVectorLayerGpsLogger with the specified parent object.

The logger will automatically record GPS information from the specified connection.

Parameters:
destinationField(self, component: Qgis.GpsInformationComponent) str[source]

Returns the destination field name for a specific GPS information component.

Parameters:

component (Qgis.GpsInformationComponent)

Return type:

str

endCurrentTrack(self)[source]

Ends the current track, storing it in the tracksLayer() if appropriate.

pointsLayer(self) QgsVectorLayer | None[source]

Returns the layer in which recorded GPS points will be stored.

May be None if points are not being stored.

See also

setPointsLayer()

See also

tracksLayer()

Return type:

Optional[QgsVectorLayer]

setDestinationField(self, component: Qgis.GpsInformationComponent, field: str | None)[source]

Sets a destination field name for a specific GPS information component.

Depending on the component, the field will either refer to the pointsLayer() or tracksLayer().

Fields stored in the pointsLayer() are:

  • Qgis.GpsInformationComponent.Location:

  • Qgis.GpsInformationComponent.Altitude:

  • Qgis.GpsInformationComponent.GroundSpeed:

  • Qgis.GpsInformationComponent.Bearing:

  • Qgis.GpsInformationComponent.Pdop:

  • Qgis.GpsInformationComponent.Hdop:

  • Qgis.GpsInformationComponent.Vdop:

  • Qgis.GpsInformationComponent.HorizontalAccuracy:

  • Qgis.GpsInformationComponent.VerticalAccuracy:

  • Qgis.GpsInformationComponent.HvAccuracy:

  • Qgis.GpsInformationComponent.SatellitesUsed:

  • Qgis.GpsInformationComponent.Timestamp:

  • Qgis.GpsInformationComponent.TrackDistanceSinceLastPoint:

  • Qgis.GpsInformationComponent.TrackTimeSinceLastPoint:

Fields stored in the tracksLayer() are:

  • Qgis.GpsInformationComponent.TrackStartTime:

  • Qgis.GpsInformationComponent.TrackEndTime:

  • Qgis.GpsInformationComponent.TotalTrackLength:

  • Qgis.GpsInformationComponent.TrackDistanceFromStart:

Parameters:
setPointsLayer(self, layer: QgsVectorLayer | None)[source]

Sets the layer in which recorded GPS points should be stored.

See also

setTracksLayer()

See also

pointsLayer()

Parameters:

layer (Optional[QgsVectorLayer])

setTracksLayer(self, layer: QgsVectorLayer | None)[source]

Sets the layer in which recorded GPS tracks should be stored.

See also

setPointsLayer()

See also

tracksLayer()

Parameters:

layer (Optional[QgsVectorLayer])

setWriteToEditBuffer(self, buffer: bool)[source]

Sets whether the logger will use the vector layer edit buffer for the destination layers.

If buffer is False then the features will be written directly to the destination layer’s data providers.

The default behavior is to use the edit buffer.

Parameters:

buffer (bool)

tracksLayer(self) QgsVectorLayer | None[source]

Returns the layer in which recorded GPS tracks will be stored.

May be None if tracks are not being stored.

See also

setTracksLayer()

See also

pointsLayer()

Return type:

Optional[QgsVectorLayer]

writeToEditBuffer(self) bool[source]

Returns True if the logger will use the vector layer edit buffer for the destination layers.

If False then the features will be written directly to the destination layer’s data providers.

The default behavior is to use the edit buffer.

Return type:

bool