16#ifndef QGSSTACCONTROLLER_H
17#define QGSSTACCONTROLLER_H
19#include <nlohmann/json.hpp>
59 std::unique_ptr< QgsStacCatalog >
openLocalCatalog(
const QString &fileName )
const;
71 std::unique_ptr< QgsStacItem >
openLocalItem(
const QString &fileName )
const;
202 void handleStacObjectReply();
203 void handleItemCollectionReply();
204 void handleCollectionsReply();
207 QNetworkReply *fetchAsync( const QUrl &url );
215 QVector<QNetworkReply *> mReplies;
Encapsulates a network reply within a container which is inexpensive to copy and safe to pass between...
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.
int fetchStacObjectAsync(const QUrl &url)
Initiates an asynchronous request for a STAC object using the url and returns an associated request i...
std::unique_ptr< QgsStacItemCollection > takeItemCollection(int requestId)
Returns the feature collection fetched with the specified requestId It should be used after the finis...
std::unique_ptr< QgsStacCollectionList > takeCollections(int requestId)
Returns the collections collection fetched with the specified requestId It should be used after the f...
std::unique_ptr< QgsStacCollection > openLocalCollection(const QString &fileName) const
Returns a STAC Collection by parsing a local file The caller takes ownership of the returned collecti...
int fetchCollectionsAsync(const QUrl &url)
Initiates an asynchronous request for a Collections collection using the url and returns an associate...
std::unique_ptr< QgsStacCatalog > openLocalCatalog(const QString &fileName) const
Returns a STAC Catalog by parsing a local file The caller takes ownership of the returned catalog.
void setAuthCfg(const QString &authCfg)
Sets the authentication config id which should be used during the request.
std::unique_ptr< QgsStacItem > openLocalItem(const QString &fileName) const
Returns a STAC Item by parsing a local file The caller takes ownership of the returned item.
std::unique_ptr< QgsStacItemCollection > fetchItemCollection(const QUrl &url, QString *error=nullptr)
Fetches a feature collection from url using a blocking network request.
int fetchItemCollectionAsync(const QUrl &url)
Initiates an asynchronous request for a feature collection using the url and returns an associated re...
QString authCfg() const
Returns the authentication config id which will be used during the request.
void finishedCollectionsRequest(int id, QString errorMessage)
This signal is fired when an async request initiated with fetchCollectionsAsync is finished.
std::unique_ptr< T > fetchStacObject(const QUrl &url, QString *error=nullptr)
Fetches a STAC object from url using a blocking network request.
void finishedItemCollectionRequest(int id, QString errorMessage)
This signal is fired when an async request initiated with fetchItemCollectionAsync is finished.
QgsStacController()=default
Default constructor.
std::unique_ptr< T > takeStacObject(int requestId)
Returns the STAC object fetched with the specified requestId.
void cancelPendingAsyncRequests()
Cancels all pending async requests.
std::unique_ptr< QgsStacCollectionList > fetchCollections(const QUrl &url, QString *error=nullptr)
Fetches collections from url using a blocking network request.
void finishedStacObjectRequest(int id, QString errorMessage)
This signal is fired when an async request initiated with fetchStacObjectAsync is finished.
Stores data associated with a STAC Item Collection.
Stores data associated with a STAC Item.
Abstract base class for storing STAC objects.