Class: QgsGml

Reads data from a WFS server or alternatively from a GML file.

It uses the expat XML parser and an event based model to keep performance high. The parsing starts when the first data arrives, it does not wait until the request is finished.

Class Hierarchy

Inheritance diagram of qgis.core.QgsGml

Base classes

QObject

class qgis.core.QgsGml[source]

Bases: QObject

crs(self) QgsCoordinateReferenceSystem[source]

Returns the spatial reference system for features.

Return type:

QgsCoordinateReferenceSystem

signal dataProgressAndSteps[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal dataReadProgress[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

featuresMap(self) Any

Gets parsed features for given type name

Return type:

Any

getFeatures(self, data: QByteArray | bytes | bytearray, extent: QgsRectangle | None = None)[source]

Read from GML data.

The constructor uri param is ignored.

Parameters:
  • data (Union[QByteArray, bytes, bytearray])

  • extent (Optional[QgsRectangle] = None) -> (int)

getFeaturesUri(self, uri: str | None, extent: QgsRectangle | None = None, userName: str | None = '', password: str | None = '', authcfg: str | None = '')

Does the HTTP GET request to the WFS server

Parameters:
  • uri (Optional[str]) – GML URL

  • wkbType – wkbType to retrieve

  • extent (Optional[QgsRectangle] = None) – retrieved extents

  • userName (Optional[str] = '') – username for authentication

  • password (Optional[str] = '') – password for authentication

  • authcfg (Optional[str] = '') -> (int) – authentication configuration id

Returns:

0 in case of success

idsMap(self) Any

Gets feature ids map

Return type:

Any

signal totalStepsUpdate[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.