Class: QgsStacController

The QgsStacController class handles STAC requests.

Contains methods to generate STAC objects from local and remote urls.

Added in version 3.44.

Class Hierarchy

Inheritance diagram of qgis.core.QgsStacController

Base classes

QObject

class qgis.core.QgsStacController[source]

Bases: QObject

__init__()

Default constructor

authCfg(self) str[source]

Returns the authentication config id which will be used during the request.

See also

setAuthCfg()

Return type:

str

cancelPendingAsyncRequests(self)[source]

Cancels all pending async requests

Added in version 3.42.

fetchCollections(self, url: QUrl, error: str | None | None = '') QgsStacCollectionList | None

Fetches collections from url using a blocking network request. An optional error parameter will be populated with any network error information. The caller takes ownership of the returned feature collection

Parameters:
  • url (QUrl)

  • error (Optional[Optional[str]] = '')

Return type:

Optional[QgsStacCollectionList]

fetchCollectionsAsync(self, url: QUrl) int[source]

Initiates an asynchronous request for a Collections collection using the url and returns an associated request id. When the request is completed, the finishedCollectionsRequest() signal is fired and the collections can be accessed with takeCollections()

Added in version 3.42.

Parameters:

url (QUrl)

Return type:

int

fetchItemCollection(self, url: QUrl, error: str | None | None = '') QgsStacItemCollection | None

Fetches a feature collection from url using a blocking network request. An optional error parameter will be populated with any network error information. The caller takes ownership of the returned feature collection

Parameters:
  • url (QUrl)

  • error (Optional[Optional[str]] = '')

Return type:

Optional[QgsStacItemCollection]

fetchItemCollectionAsync(self, url: QUrl) int[source]

Initiates an asynchronous request for a feature collection using the url and returns an associated request id. When the request is completed, the finishedItemCollectionRequest() signal is fired and the feature collection can be accessed with takeItemCollection()

Parameters:

url (QUrl)

Return type:

int

fetchStacObjectAsync(self, url: QUrl) int[source]

Initiates an asynchronous request for a STAC object using the url and returns an associated request id. When the request is completed, the finishedStacObjectRequest() signal is fired and the stac object can be accessed with takeStacObject()

Parameters:

url (QUrl)

Return type:

int

signal finishedCollectionsRequest[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 finishedItemCollectionRequest[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 finishedStacObjectRequest[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.

openLocalCatalog(self, fileName: str | None) QgsStacCatalog | None

Returns a STAC Catalog by parsing a local file The caller takes ownership of the returned catalog

Parameters:

fileName (Optional[str])

Return type:

Optional[QgsStacCatalog]

openLocalCollection(self, fileName: str | None) QgsStacCollection | None

Returns a STAC Collection by parsing a local file The caller takes ownership of the returned collection

Parameters:

fileName (Optional[str])

Return type:

Optional[QgsStacCollection]

openLocalItem(self, fileName: str | None) QgsStacItem | None

Returns a STAC Item by parsing a local file The caller takes ownership of the returned item

Parameters:

fileName (Optional[str])

Return type:

Optional[QgsStacItem]

setAuthCfg(self, authCfg: str | None)[source]

Sets the authentication config id which should be used during the request.

See also

authCfg()

Parameters:

authCfg (Optional[str])

takeCollections(self, requestId: int) QgsStacCollectionList | None

Returns the collections collection fetched with the specified requestId It should be used after the finishedCollectionsRequest signal is fired to get the fetched STAC collections. Returns None if the requestId was not found, request was canceled, request failed or parsing the STAC object failed. The caller takes ownership of the returned collections

Added in version 3.42.

Parameters:

requestId (int)

Return type:

Optional[QgsStacCollectionList]

takeItemCollection(self, requestId: int) QgsStacItemCollection | None

Returns the feature collection fetched with the specified requestId It should be used after the finishedItemCollectionRequest signal is fired to get the fetched STAC item collection. Returns None if the requestId was not found, request was canceled, request failed or parsing the STAC object failed. The caller takes ownership of the returned feature collection

Parameters:

requestId (int)

Return type:

Optional[QgsStacItemCollection]