Class: QgsVectorLayerGpsLogger

class qgis.core.QgsVectorLayerGpsLogger

Bases: QgsGpsLogger

Handles logging of incoming GPS data to a vector layer.

New in version 3.30.

QgsVectorLayerGpsLogger(connection: QgsGpsConnection, parent: QObject = None) Constructor for QgsVectorLayerGpsLogger with the specified parent object.

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

Methods

addTrackVertex

Adds a track vertex at the current GPS location.

childEvent

connectNotify

customEvent

destinationField

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

disconnectNotify

endCurrentTrack

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

isSignalConnected

pointsLayer

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

receivers

sender

senderSignalIndex

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.

setTransformContext

param context:

setWriteToEditBuffer

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

timerEvent

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.

addTrackVertex(self)

Adds a track vertex at the current GPS location.

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
destinationField(self, component: Qgis.GpsInformationComponent) str

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

Parameters:

component (Qgis.GpsInformationComponent) –

Return type:

str

disconnectNotify(self, QMetaMethod)
endCurrentTrack(self)

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

isSignalConnected(self, QMetaMethod) bool
pointsLayer(self) QgsVectorLayer

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:

QgsVectorLayer

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setDestinationField(self, component: Qgis.GpsInformationComponent, field: str)

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)

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

See also

setTracksLayer()

See also

pointsLayer()

Parameters:

layer (QgsVectorLayer) –

setTracksLayer(self, layer: QgsVectorLayer)

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

See also

setPointsLayer()

See also

tracksLayer()

Parameters:

layer (QgsVectorLayer) –

setTransformContext(self, context: QgsCoordinateTransformContext)
Parameters:

context (QgsCoordinateTransformContext) –

setWriteToEditBuffer(self, buffer: bool)

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

timerEvent(self, QTimerEvent)
tracksLayer(self) QgsVectorLayer

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:

QgsVectorLayer

writeToEditBuffer(self) bool

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