16#ifndef QGSSTACPARSER_H
17#define QGSSTACPARSER_H
19#include <nlohmann/json.hpp>
50 void setData(
const QByteArray &data );
63 std::unique_ptr< QgsStacCatalog >
catalog();
98 QString
error() const;
105 std::unique_ptr< QgsStacItem > parseItem(
const nlohmann::json &data );
106 std::unique_ptr< QgsStacCatalog > parseCatalog(
const nlohmann::json &data );
107 std::unique_ptr< QgsStacCollection > parseCollection(
const nlohmann::json &data );
109 QVector< QgsStacLink > parseLinks(
const nlohmann::json &data );
110 QMap< QString, QgsStacAsset > parseAssets(
const nlohmann::json &data );
111 static bool isSupportedStacVersion(
const QString &version );
113 static QString getString(
const nlohmann::json &data );
115 nlohmann::json mData;
117 std::unique_ptr<QgsStacObject> mObject;
Provides global constants and enumerations for use throughout the application.
StacObjectType
Available types of stac objects.
@ Unknown
Type is not known.
Stores data associated with a STAC Catalog.
Stores a list of STAC Collections, which is typically used to store the data returned by STAC API /co...
Stores data associated with a STAC Collection.
Stores data associated with a STAC Item Collection.
Stores data associated with a STAC Item.
QString error() const
Returns the last parsing error.
QgsStacCollectionList * collections()
Returns the parsed STAC API Collections If parsing failed, nullptr is returned The caller takes owner...
void setBaseUrl(const QUrl &url)
Sets the base url that will be used to resolve relative links.
QgsStacParser()=default
Default constructor.
std::unique_ptr< QgsStacItem > item()
Returns the parsed STAC Item If parsing failed, nullptr is returned The caller takes ownership of the...
std::unique_ptr< QgsStacItemCollection > itemCollection()
Returns the parsed STAC API Item Collection If parsing failed, nullptr is returned The caller takes o...
std::unique_ptr< QgsStacCatalog > catalog()
Returns the parsed STAC Catalog If parsing failed, nullptr is returned The caller takes ownership of ...
Qgis::StacObjectType type() const
Returns the type of the parsed object.
std::unique_ptr< QgsStacCollection > collection()
Returns the parsed STAC Collection If parsing failed, nullptr is returned The caller takes ownership ...
void setData(const QByteArray &data)
Sets the JSON data to be parsed.