Class: QgsOWSSourceSelect

Dialog to create connections and add layers WCS etc.

This dialog allows the user to define and save connection information for WMS servers, etc.

The user can then connect and add layers from the WCS server to the map canvas.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOWSSourceSelect

Base classes

QgsAbstractDataSourceWidget

Abstract base class for Data Source widgets to create connections and add layers.

QDialog

QWidget

QObject

QPaintDevice

Methods

addDefaultServers

Add a few example servers to the list.

clearCrs

Clear CRSs

clearFormats

Clear previously set formats

clearTimes

Clear times

connName

Connection name

connectionInfo

Connection info (uri)

descriptionForAuthId

Returns a textual description for the authority id

populateConnectionList

Populate the connection list combo box

populateCrs

Sets supported CRSs

populateFormats

Populate supported formats

populateTimes

Populate times

prepareExtent

Prepares the spatial extent box with the general settings including original crs, destination crs and the map canvas if it is available.

selectedCacheLoadControl

Returns currently selected cache load control

selectedCrs

Returns currently selected Crs

selectedFormat

Returns currently selected format

selectedTime

Returns currently selected time

setConnectionListPosition

Sets the server connection combo box to that stored in the config file.

showError

show whatever error is exposed.

showStatusMessage

Sets status message to theMessage

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsOWSSourceSelect. See the FAQ for more details.

enableLayersForCrs

layer name derived from latest layer selection (updated as long it's not edited manually)

populateLayerList

Populate the layer list.

providerFormats

List of image formats (encodings) supported by provider

refresh

Triggered when the provider's connections need to be refreshed

selectedLayersCrses

Server CRS supported for currently selected layer item(s)

selectedLayersFormats

List of formats supported for currently selected layer item(s)

selectedLayersTimes

List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)

class qgis.gui.QgsOWSSourceSelect[source]

Bases: QgsAbstractDataSourceWidget

__init__(service: str | None, parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags, widgetMode: QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)

Constructor

Parameters:
  • service (Optional[str])

  • parent (Optional[QWidget] = None)

  • fl (Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)

  • widgetMode (QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)

class SupportedFormat

Bases: object

Formats supported by provider

format
label
addDefaultServers(self)[source]

Add a few example servers to the list.

clearCrs(self)[source]

Clear CRSs

clearFormats(self)[source]

Clear previously set formats

clearTimes(self)[source]

Clear times

connName(self) str[source]

Connection name

Return type:

str

connectionInfo(self) str[source]

Connection info (uri)

Return type:

str

descriptionForAuthId(self, authId: str | None) str[source]

Returns a textual description for the authority id

Parameters:

authId (Optional[str])

Return type:

str

virtual enableLayersForCrs(self, item: QTreeWidgetItem | None)[source]

layer name derived from latest layer selection (updated as long it’s not edited manually)

Parameters:

item (Optional[QTreeWidgetItem])

populateConnectionList(self)[source]

Populate the connection list combo box

populateCrs(self)[source]

Sets supported CRSs

populateFormats(self)[source]

Populate supported formats

virtual populateLayerList(self)[source]

Populate the layer list.

populateTimes(self)[source]

Populate times

prepareExtent(self)[source]

Prepares the spatial extent box with the general settings including original crs, destination crs and the map canvas if it is available.

Added in version 3.26.

virtual providerFormats(self) List[QgsOWSSourceSelect.SupportedFormat]

List of image formats (encodings) supported by provider

Return type:

List[QgsOWSSourceSelect.SupportedFormat]

Returns:

list of format/label pairs

virtual refresh(self)[source]

Triggered when the provider’s connections need to be refreshed

selectedCacheLoadControl(self) QNetworkRequest.CacheLoadControl[source]

Returns currently selected cache load control

Return type:

QNetworkRequest.CacheLoadControl

selectedCrs(self) str[source]

Returns currently selected Crs

Return type:

str

selectedFormat(self) str[source]

Returns currently selected format

Return type:

str

virtual selectedLayersCrses(self) List[str][source]

Server CRS supported for currently selected layer item(s)

Return type:

List[str]

virtual selectedLayersFormats(self) List[str][source]

List of formats supported for currently selected layer item(s)

Return type:

List[str]

virtual selectedLayersTimes(self) List[str][source]

List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)

Return type:

List[str]

selectedTime(self) str[source]

Returns currently selected time

Return type:

str

setConnectionListPosition(self)[source]

Sets the server connection combo box to that stored in the config file.

showError(self, title: str | None, format: str | None, error: str | None)[source]

show whatever error is exposed.

Parameters:
  • title (Optional[str])

  • format (Optional[str])

  • error (Optional[str])

showStatusMessage(self, message: str | None)[source]

Sets status message to theMessage

Parameters:

message (Optional[str])