QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
stac
qgsstacparser.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsstacparser.h
3
---------------------
4
begin : August 2024
5
copyright : (C) 2024 by Stefanos Natsis
6
email : uclaros at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSSTACPARSER_H
17
#define QGSSTACPARSER_H
18
19
#include <nlohmann/json.hpp>
20
21
#include "
qgis.h
"
22
#include "
qgsstacasset.h
"
23
#include "
qgsstacobject.h
"
24
25
#include <QUrl>
26
27
class
QgsStacCatalog
;
28
class
QgsStacCollection
;
29
class
QgsStacCollectionList
;
30
class
QgsStacItem
;
31
class
QgsStacItemCollection
;
32
33
43
class
CORE_EXPORT
QgsStacParser
44
{
45
public
:
47
QgsStacParser
() =
default
;
48
50
void
setData
(
const
QByteArray &data );
51
56
void
setBaseUrl
(
const
QUrl &url );
57
63
std::unique_ptr< QgsStacCatalog >
catalog
();
64
65
71
std::unique_ptr< QgsStacCollection >
collection
()
SIP_SKIP
;
72
78
std::unique_ptr<
QgsStacItem
>
item
()
SIP_SKIP
;
79
85
std::unique_ptr<
QgsStacItemCollection
>
itemCollection
()
SIP_SKIP
;
86
92
QgsStacCollectionList
*
collections
();
93
95
Qgis
::StacObjectType
type
() const;
96
98
QString
error
() const;
99
100
private:
101
#ifdef SIP_RUN
102
QgsStacParser
(
const
QgsStacParser
&rh )
SIP_FORCE
;
103
#endif
104
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 );
108
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 );
114
115
nlohmann::json mData;
116
Qgis::StacObjectType
mType =
Qgis::StacObjectType::Unknown
;
117
std::unique_ptr<QgsStacObject> mObject;
118
QString mError;
119
QUrl mBaseUrl;
120
};
121
122
123
#endif
// QGSSTACPARSER_H
Qgis
Provides global constants and enumerations for use throughout the application.
Definition
qgis.h:62
Qgis::StacObjectType
StacObjectType
Available types of stac objects.
Definition
qgis.h:7007
Qgis::StacObjectType::Unknown
@ Unknown
Type is not known.
Definition
qgis.h:7008
QgsStacCatalog
Stores data associated with a STAC Catalog.
Definition
qgsstaccatalog.h:33
QgsStacCollectionList
Stores a list of STAC Collections, which is typically used to store the data returned by STAC API /co...
Definition
qgsstaccollectionlist.h:34
QgsStacCollection
Stores data associated with a STAC Collection.
Definition
qgsstaccollection.h:33
QgsStacItemCollection
Stores data associated with a STAC Item Collection.
Definition
qgsstacitemcollection.h:37
QgsStacItem
Stores data associated with a STAC Item.
Definition
qgsstacitem.h:35
QgsStacParser::error
QString error() const
Returns the last parsing error.
Definition
qgsstacparser.cpp:85
QgsStacParser::collections
QgsStacCollectionList * collections()
Returns the parsed STAC API Collections If parsing failed, nullptr is returned The caller takes owner...
Definition
qgsstacparser.cpp:492
QgsStacParser::setBaseUrl
void setBaseUrl(const QUrl &url)
Sets the base url that will be used to resolve relative links.
Definition
qgsstacparser.cpp:75
QgsStacParser::QgsStacParser
QgsStacParser()=default
Default constructor.
QgsStacParser::item
std::unique_ptr< QgsStacItem > item()
Returns the parsed STAC Item If parsing failed, nullptr is returned The caller takes ownership of the...
Definition
qgsstacparser.cpp:289
QgsStacParser::itemCollection
std::unique_ptr< QgsStacItemCollection > itemCollection()
Returns the parsed STAC API Item Collection If parsing failed, nullptr is returned The caller takes o...
Definition
qgsstacparser.cpp:456
QgsStacParser::catalog
std::unique_ptr< QgsStacCatalog > catalog()
Returns the parsed STAC Catalog If parsing failed, nullptr is returned The caller takes ownership of ...
Definition
qgsstacparser.cpp:90
QgsStacParser::type
Qgis::StacObjectType type() const
Returns the type of the parsed object.
Definition
qgsstacparser.cpp:80
QgsStacParser::collection
std::unique_ptr< QgsStacCollection > collection()
Returns the parsed STAC Collection If parsing failed, nullptr is returned The caller takes ownership ...
Definition
qgsstacparser.cpp:146
QgsStacParser::setData
void setData(const QByteArray &data)
Sets the JSON data to be parsed.
Definition
qgsstacparser.cpp:30
qgis.h
SIP_FORCE
#define SIP_FORCE
Definition
qgis_sip.h:143
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
qgsstacasset.h
qgsstacobject.h
Generated on
for QGIS API Documentation by
1.17.0