Class: QgsGml

class qgis.core.QgsGml

Bases: PyQt5.QtCore.QObject

This class 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

Methods

childEvent

connectNotify

crs

Returns features spatial reference system

customEvent

disconnectNotify

featuresMap

Gets parsed features for given type name

getFeatures

Read from GML data.

getFeaturesUri

Does the Http GET request to the wfs server

idsMap

Gets feature ids map

isSignalConnected

receivers

sender

senderSignalIndex

timerEvent

Signals

dataProgressAndSteps

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

dataReadProgress

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

totalStepsUpdate

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

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
crs(self) QgsCoordinateReferenceSystem

Returns features spatial reference system

New in version 2.1.

Return type

QgsCoordinateReferenceSystem

customEvent(self, QEvent)
dataProgressAndSteps

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

dataReadProgress

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

disconnectNotify(self, QMetaMethod)
featuresMap(self) object

Gets parsed features for given type name

Return type

object

getFeatures(self, data: Union[QByteArray, bytes, bytearray], extent: QgsRectangle = None) Tuple[int, QgsWkbTypes.Type]

Read from GML data. Constructor uri param is ignored

Parameters
  • data (Union[QByteArray) –

  • extent (QgsRectangle = None) –

Return type

Tuple[int, QgsWkbTypes.Type]

getFeaturesUri(self, uri: str, extent: QgsRectangle = None, userName: str = '', password: str = '', authcfg: str = '') Tuple[int, QgsWkbTypes.Type]

Does the Http GET request to the wfs server

Parameters
  • uri (str) – GML URL

  • wkbType – wkbType to retrieve

  • extent (QgsRectangle = None) – retrieved extents

  • userName (str = '') – username for authentication

  • password (str = '') – password for authentication

  • authcfg (str = '') – authentication configuration id

Return type

Tuple[int, QgsWkbTypes.Type]

Returns

0 in case of success

Note

available in Python as getFeaturesUri

idsMap(self) object

Gets feature ids map

Return type

object

isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)
totalStepsUpdate

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL