Class: QgsGeoNodeRequest¶
- class qgis.core.QgsGeoNodeRequest¶
Bases:
PyQt5.QtCore.QObject
Request handler for GeoNode servers.
QgsGeoNodeRequest
handles requesting and parsing service details from a GeoNode server instance, for instance requesting all available layers or layer styles.New in version 3.0.
QgsGeoNodeRequest(baseUrl: str, forceRefresh: bool, parent: QObject = None) Constructor for QgsGeoNodeRequest.
If
forceRefresh
isFalse
, then cached copies of the request may be reused.Enums
Bases:
enum.IntEnum
Methods
Aborts any active network request immediately.
Requests the default style for the layer with matching
layerName
from the server.Triggers a new request to fetch the list of available layers from the server.
Requests the list of available layers from the server.
Obtains a map of layer name to URL for available services with matching
serviceType
from the server.Requests the list of unique URLs for available services with matching
serviceType
from the server.Requests the details for the style with matching
styleId
from the server.Requests the list of available styles for the layer with matching
layerName
from the server.Returns the most recent error string for any encountered errors, or an empty string if no errors have been encountered.
Returns the most recent response obtained from the server.
Returns the updated ServiceLayerDetail struct with WMS/WFS/XYZ url.
Returns the network protocol (e.g. 'http') used for connecting with the server.
Triggers a new request to the GeoNode server, with the requested
endPoint
.Triggers a new request to the GeoNode server, with the requested
endPoint
.Sets the network
protocol
(e.g. 'http') used for connecting with the server.Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- class BackendServer(value)¶
Bases:
enum.IntEnum
GeoNode backend server type.
Unknown
: Unknown backendQgisServer
: QGIS server used as backendGeoserver
: Geoserver used as backend
- Geoserver = 2¶
- QgisServer = 1¶
- Unknown = 0¶
- class ServiceLayerDetail¶
- class ServiceLayerDetail(QgsGeoNodeRequest.ServiceLayerDetail)
Bases:
sip.wrapper
- id¶
- name¶
- server¶
- title¶
- typeName¶
- uuid¶
- wcsURL¶
- wfsURL¶
- wmsURL¶
- xyzURL¶
- abort(self)¶
Aborts any active network request immediately.
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- fetchDefaultStyleBlocking(self, layerName: str) QgsGeoNodeStyle ¶
Requests the default style for the layer with matching
layerName
from the server.This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
- Parameters:
layerName (str) –
- Return type:
- fetchLayers(self)¶
Triggers a new request to fetch the list of available layers from the server. When complete, the
layersFetched()
signal will be emitted with the result.This method is non-blocking and returns immediately.
Warning
When using the non-blocking methods in this class, sending overlapping requests results in undefined behavior. Use separate instances of
QgsGeoNodeRequest
instead to avoid this.See also
See also
- fetchLayersBlocking(self) List[QgsGeoNodeRequest.ServiceLayerDetail] ¶
Requests the list of available layers from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
See also
- Return type:
- fetchServiceUrlDataBlocking(self, serviceType: str) Dict[str, str] ¶
Obtains a map of layer name to URL for available services with matching
serviceType
from the server.This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
- Parameters:
serviceType (str) –
- Return type:
Dict[str, str]
- fetchServiceUrlsBlocking(self, serviceType: str) List[str] ¶
Requests the list of unique URLs for available services with matching
serviceType
from the server.This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
- Parameters:
serviceType (str) –
- Return type:
List[str]
- fetchStyleBlocking(self, styleId: str) QgsGeoNodeStyle ¶
Requests the details for the style with matching
styleId
from the server.This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
- Parameters:
styleId (str) –
- Return type:
- fetchStylesBlocking(self, layerName: str) List[QgsGeoNodeStyle] ¶
Requests the list of available styles for the layer with matching
layerName
from the server.This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
- Parameters:
layerName (str) –
- Return type:
List[QgsGeoNodeStyle]
- isSignalConnected(self, QMetaMethod) bool ¶
- lastError(self) str ¶
Returns the most recent error string for any encountered errors, or an empty string if no errors have been encountered.
- Return type:
str
- lastResponse(self) QByteArray ¶
Returns the most recent response obtained from the server.
- Return type:
QByteArray
- layersFetched¶
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
- parseOwsUrl(self, layerStruct: QgsGeoNodeRequest.ServiceLayerDetail, layerLinks: Iterable[Any]) QgsGeoNodeRequest.ServiceLayerDetail ¶
Returns the updated ServiceLayerDetail struct with WMS/WFS/XYZ url.
- Parameters:
layerStruct (QgsGeoNodeRequest.ServiceLayerDetail) –
layerLinks (Iterable[Any]) –
- Return type:
- protocol(self) str ¶
Returns the network protocol (e.g. ‘http’) used for connecting with the server.
See also
- Return type:
str
- receivers(self, PYQT_SIGNAL) int ¶
- request(self, endPoint: str)¶
Triggers a new request to the GeoNode server, with the requested
endPoint
. Any existing request will be aborted.Calling this method does not block while waiting for a result.
Warning
When using the non-blocking methods in this class, sending overlapping requests results in undefined behavior. Use separate instances of
QgsGeoNodeRequest
instead to avoid this.See also
- Parameters:
endPoint (str) –
- requestBlocking(self, endPoint: str) bool ¶
Triggers a new request to the GeoNode server, with the requested
endPoint
. Any existing request will be aborted.Calling this method will block while waiting for a result. It should not be used from any code which potentially blocks operation in the main GUI thread.
See also
- Parameters:
endPoint (str) –
- Return type:
bool
- requestFinished¶
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
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setProtocol(self, protocol: str)¶
Sets the network
protocol
(e.g. ‘http’) used for connecting with the server.See also
- Parameters:
protocol (str) –
- statusChanged¶
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
- timerEvent(self, QTimerEvent)¶