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¶
Base classes¶
Methods
Returns the authentication config id which will be used during the request. |
|
Cancels all pending async requests |
|
Fetches collections from url using a blocking network request. |
|
Initiates an asynchronous request for a Collections collection using the url and returns an associated request id. |
|
Fetches a feature collection from url using a blocking network request. |
|
Initiates an asynchronous request for a feature collection using the url and returns an associated request id. |
|
Initiates an asynchronous request for a STAC object using the url and returns an associated request id. |
|
Returns a STAC Catalog by parsing a local file The caller takes ownership of the returned catalog |
|
Returns a STAC Collection by parsing a local file The caller takes ownership of the returned collection |
|
Returns a STAC Item by parsing a local file The caller takes ownership of the returned item |
|
Sets the authentication config id which should be used during the request. |
|
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 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. |
Signals
This signal is fired when an async request initiated with fetchCollectionsAsync is finished. |
|
This signal is fired when an async request initiated with fetchItemCollectionAsync is finished. |
|
This signal is fired when an async request initiated with fetchStacObjectAsync is finished. |
- 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
- Return type:
str
- fetchCollections(self, url: QUrl, error: str | None | None = '') QgsStacCollectionList | None ¶
Fetches collections from
url
using a blocking network request. An optionalerror
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, thefinishedCollectionsRequest()
signal is fired and the collections can be accessed withtakeCollections()
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 optionalerror
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, thefinishedItemCollectionRequest()
signal is fired and the feature collection can be accessed withtakeItemCollection()
- 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, thefinishedStacObjectRequest()
signal is fired and the stac object can be accessed withtakeStacObject()
- Parameters:
url (QUrl)
- Return type:
int
- signal finishedCollectionsRequest(id: int, errorMessage: str)[source]¶
This signal is fired when an async request initiated with fetchCollectionsAsync is finished. The parsed STAC collections collection can be retrieved using takeCollections
- Parameters:
id (int) – The requestId attribute of the finished request
errorMessage (str) – Reason the request or parsing of the STAC collections may have failed
See also
See also
Added in version 3.42.
- signal finishedItemCollectionRequest(id: int, errorMessage: str)[source]¶
This signal is fired when an async request initiated with fetchItemCollectionAsync is finished. The parsed STAC item collection can be retrieved using takeItemCollection
- Parameters:
id (int) – The requestId attribute of the finished request
errorMessage (str) – Reason the request or parsing of the STAC item collection may have failed
See also
See also
- signal finishedStacObjectRequest(id: int, errorMessage: str)[source]¶
This signal is fired when an async request initiated with fetchStacObjectAsync is finished. The parsed STAC object can be retrieved using takeStacObject
- Parameters:
id (int) – The requestId attribute of the finished request
errorMessage (str) – Reason the request or parsing of the STAC object may have failed
See also
See also
takeStacObject()
- 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
- 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. ReturnsNone
if the requestId was not found, request was canceled, request failed or parsing the STAC object failed. The caller takes ownership of the returned collectionsSee also
See also
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. ReturnsNone
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 collectionSee also
See also
- Parameters:
requestId (int)
- Return type:
Optional[QgsStacItemCollection]