Class: QgsStacParser

SpatioTemporal Asset Catalog JSON parser.

This class parses json data and creates the appropriate STAC Catalog, Collection, Item or ItemCollection.

Added in version 3.44.

Methods

catalog

Returns the parsed STAC Catalog If parsing failed, None is returned The caller takes ownership of the returned catalog

collections

Returns the parsed STAC API Collections If parsing failed, None is returned The caller takes ownership of the returned collections

error

Returns the last parsing error

setBaseUrl

Sets the base url that will be used to resolve relative links.

setData

Sets the JSON data to be parsed

type

Returns the type of the parsed object

class qgis.core.QgsStacParser[source]

Bases: object

__init__()

Default constructor

catalog(self) QgsStacCatalog | None

Returns the parsed STAC Catalog If parsing failed, None is returned The caller takes ownership of the returned catalog

Return type:

Optional[QgsStacCatalog]

collections(self) QgsStacCollectionList | None[source]

Returns the parsed STAC API Collections If parsing failed, None is returned The caller takes ownership of the returned collections

Return type:

Optional[QgsStacCollectionList]

error(self) str[source]

Returns the last parsing error

Return type:

str

setBaseUrl(self, url: QUrl)[source]

Sets the base url that will be used to resolve relative links. If not called, relative links will not be resolved to absolute links.

Parameters:

url (QUrl)

setData(self, data: QByteArray | bytes | bytearray)[source]

Sets the JSON data to be parsed

Parameters:

data (Union[QByteArray, bytes, bytearray])

type(self) Qgis.StacObjectType[source]

Returns the type of the parsed object

Return type:

Qgis.StacObjectType