Class: QgsAbstractBabelFormat

Abstract base class for babel GPS formats.

Added in version 3.22.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAbstractBabelFormat

Subclasses

QgsBabelGpsDeviceFormat

A babel format capable of interacting directly with a GPS device.

QgsBabelSimpleImportFormat

A babel format capable of converting input files to GPX files.

Methods

capabilities

Returns the format's capabilities.

exportCommand

Generates a command for exporting GPS data into a different format using babel.

importCommand

Generates a command for importing data into a GPS format using babel.

name

Returns the format's name.

Static Methods

featureTypeToArgument

Converts a GPS feature type to the equivalent babel argument.

class qgis.core.QgsAbstractBabelFormat[source]

Bases: object

__init__(name: str | None = '')

Constructor for QgsAbstractBabelFormat, with the specified name.

Parameters:

name (Optional[str] = '')

__init__(a0: QgsAbstractBabelFormat)
Parameters:

a0 (QgsAbstractBabelFormat)

capabilities(self) Qgis.BabelFormatCapabilities[source]

Returns the format’s capabilities.

Return type:

Qgis.BabelFormatCapabilities

exportCommand(self, babel: str | None, featureType: Qgis.GpsFeatureType, input: str | None, output: str | None, flags: Qgis.BabelCommandFlags | Qgis.BabelCommandFlag = Qgis.BabelCommandFlags()) List[str][source]

Generates a command for exporting GPS data into a different format using babel.

Parameters:
  • babel (Optional[str]) – path to the babel executable

  • featureType (Qgis.GpsFeatureType) – type of GPS feature to export

  • input (Optional[str]) – input data path

  • output (Optional[str]) – output path

  • flags (Union[Qgis.BabelCommandFlags, Qgis.BabelCommandFlag] = Qgis.BabelCommandFlags()) – optional flags to control how babel command is generated

Returns an empty list if the format does not support exports (see capabilities()).

Return type:

List[str]

static featureTypeToArgument(type: Qgis.GpsFeatureType) str[source]

Converts a GPS feature type to the equivalent babel argument.

Parameters:

type (Qgis.GpsFeatureType)

Return type:

str

importCommand(self, babel: str | None, featureType: Qgis.GpsFeatureType, input: str | None, output: str | None, flags: Qgis.BabelCommandFlags | Qgis.BabelCommandFlag = Qgis.BabelCommandFlags()) List[str][source]

Generates a command for importing data into a GPS format using babel.

Parameters:
  • babel (Optional[str]) – babel path to the babel executable

  • featureType (Qgis.GpsFeatureType) – type of GPS feature to import

  • input (Optional[str]) – input data path

  • output (Optional[str]) – output path

  • flags (Union[Qgis.BabelCommandFlags, Qgis.BabelCommandFlag] = Qgis.BabelCommandFlags()) – optional flags to control how babel command is generated

Returns an empty list if the format does not support imports (see capabilities()).

Return type:

List[str]

name(self) str[source]

Returns the format’s name.

Return type:

str