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 Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.

idsMap

Gets feature ids map

isSignalConnected

receivers

sender

senderSignalIndex

timerEvent

Signals

dataProgressAndSteps

Also emit signal with progress and totalSteps together (this is better for the status message) [signal]

dataReadProgress

dataReadProgress(self, progress: int) [signal]

totalStepsUpdate

totalStepsUpdate(self, totalSteps: int) [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

Also emit signal with progress and totalSteps together (this is better for the status message) [signal]

Parameters
  • progress (int) –

  • totalSteps (int) –

dataReadProgress

dataReadProgress(self, progress: int) [signal]

Parameters

progress (int) –

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 Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.

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 Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.

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

totalStepsUpdate(self, totalSteps: int) [signal]

Parameters

totalSteps (int) –