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 forQgsVectorLayerGpsLogger
with the specifiedparent
object.The logger will automatically record GPS information from the specified
connection
.Methods
Adds a track vertex at the current GPS location.
Returns the destination field name for a specific GPS information
component
.Ends the current track, storing it in the
tracksLayer()
if appropriate.Returns the layer in which recorded GPS points will be stored.
Sets a destination
field
name for a specific GPS informationcomponent
.Sets the
layer
in which recorded GPS points should be stored.Sets the
layer
in which recorded GPS tracks should be stored.- param context:
Sets whether the logger will use the vector layer edit buffer for the destination layers.
Returns the layer in which recorded GPS tracks will be stored.
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
.See also
- 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
See also
- Return type:
- 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 informationcomponent
.Depending on the
component
, the field will either refer to thepointsLayer()
ortracksLayer()
.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:
See also
- Parameters:
component (Qgis.GpsInformationComponent) –
field (str) –
- setPointsLayer(self, layer: QgsVectorLayer)¶
Sets the
layer
in which recorded GPS points should be stored.See also
See also
- Parameters:
layer (QgsVectorLayer) –
- setTracksLayer(self, layer: QgsVectorLayer)¶
Sets the
layer
in which recorded GPS tracks should be stored.See also
See also
- 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
isFalse
then the features will be written directly to the destination layer’s data providers.The default behavior is to use the edit buffer.
See also
- 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
See also
- Return type:
- 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.
See also
- Return type:
bool