19#include <QTextDocument>
21using namespace Qt::StringLiterals;
36 QString html = u
"<html><head></head>\n<body>\n"_s;
38 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Collection"_L1 );
39 html +=
"<table class=\"list-view\">\n"_L1;
40 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"id"_s,
id() );
41 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"stac_version"_s,
stacVersion() );
42 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"title"_s,
title() );
45 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"description"_s, descr.toHtml() );
46 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"license"_s,
license() );
47 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"keywords"_s,
keywords().join(
',' ) );
48 html +=
"</table>\n"_L1;
52 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Extensions"_L1 );
56 html += u
"<li>%1</li>\n"_s.arg( extension );
63 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Conformance Classes"_L1 );
67 html += u
"<li>%1</li>\n"_s.arg( cc );
72 if ( !mProviders.isEmpty() )
74 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Providers"_L1 );
78 html +=
"<table class=\"list-view\">\n"_L1;
79 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"name"_s, p.name() );
80 descr.setMarkdown( p.description() );
81 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"description"_s, descr.toHtml() );
82 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"roles"_s, p.roles().join(
',' ) );
83 html += u
"<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n"_s.arg( u
"url"_s, p.url() );
84 html +=
"</table><br/>\n"_L1;
88 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Spatial Extent"_L1 );
89 html +=
"<table class=\"list-view\">\n"_L1;
91 if ( mExtent.spatialExtent().is3D() )
92 extentString = mExtent.spatialExtent().toString();
94 extentString = mExtent.spatialExtent().toRectangle().toString();
95 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"overall"_s, extentString );
98 if ( mExtent.hasDetailedSpatialExtents() )
100 const QVector< QgsBox3D > extents = mExtent.detailedSpatialExtents();
103 QString extentString;
105 extentString =
extent.toString();
107 extentString =
extent.toRectangle().toString();
108 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"detailed"_s, extentString );
111 html +=
"</table><br/>\n"_L1;
114 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Temporal Extent"_L1 );
115 html +=
"<table class=\"list-view\">\n"_L1;
116 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"start"_s, mExtent.temporalExtent().begin().toString() );
117 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"end"_s, mExtent.temporalExtent().end().toString() );
118 html +=
"</table><br/>\n"_L1;
120 if ( mExtent.hasDetailedTemporalExtents() )
122 html +=
"Detailed extents:\n"_L1;
123 const QVector< QgsDateTimeRange > extents = mExtent.detailedTemporalExtents();
126 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Temporal Extent"_L1 );
127 html +=
"<table class=\"list-view\">\n"_L1;
128 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"start"_s,
extent.begin().toString() );
129 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"end"_s,
extent.end().toString() );
130 html +=
"</table><br/>\n"_L1;
134 if ( !mSummaries.isEmpty() )
136 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Summaries"_L1 );
137 html +=
"<table class=\"list-view\">\n"_L1;
138 for (
auto it = mSummaries.constBegin(); it != mSummaries.constEnd(); ++it )
140 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( it.key(), it.value().toString() );
142 html +=
"</table><br/>\n"_L1;
145 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Links"_L1 );
148 html +=
"<table class=\"list-view\">\n"_L1;
149 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"relation"_s, link.relation() );
150 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"title"_s, link.title() );
151 html += u
"<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n"_s.arg( u
"url"_s, link.href() );
152 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"type"_s, link.mediaType() );
153 html +=
"</table><br/>\n"_L1;
156 if ( !mAssets.isEmpty() )
159 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Assets"_L1 );
160 for (
auto it = mAssets.constBegin(); it != mAssets.constEnd(); ++it )
162 html +=
"<table class=\"list-view\">\n"_L1;
163 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"id"_s, it.key() );
164 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"title"_s, it->title() );
165 descr.setMarkdown( it->description() );
166 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"description"_s, descr.toHtml() );
167 html += u
"<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n"_s.arg( u
"url"_s, it->href() );
168 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"type"_s, it->mediaType() );
169 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"roles"_s, it->roles().join(
',' ) );
170 html +=
"</table><br/>\n"_L1;
174 html +=
"\n</body>\n</html>\n"_L1;
StacObjectType
Available types of stac objects.
@ Collection
STAC collection.
A 3-dimensional box composed of x, y, z coordinates.
QString description() const
Returns a Detailed multi-line description to fully explain the Catalog.
QSet< QString > mConformanceClasses
QgsStacCatalog()=delete
Default constructor deleted, use the variant with required parameters.
QString title() const
Returns a short descriptive one-line title for the Catalog.
void setSummaries(const QVariantMap &summaries)
Sets the map of property summaries to the collection.
void setExtent(const QgsStacExtent &extent)
Sets the collection's spatial and temporal extent.
QString license() const
Returns the Collection's license(s), either a SPDX License identifier, various if multiple licenses a...
void setKeywords(const QStringList &keywords)
Sets the list of keywords describing the Collection.
QString toHtml() const override
Returns an HTML representation of the STAC object.
Qgis::StacObjectType type() const override
Returns the Type of the STAC object.
QVariantMap summaries() const
Returns a map of property summaries from the collection.
void setLicense(const QString &license)
Sets the Collection's license(s), either a SPDX License identifier, various if multiple licenses appl...
QVector< QgsStacProvider > providers() const
Returns a list of providers, which may include all organizations capturing or processing the data or ...
QgsStacCollection()=delete
Default constructor deleted, use the variant with required parameters.
void setProviders(const QVector< QgsStacProvider > &providers)
Sets a list of providers, which may include all organizations capturing or processing the data or the...
QgsStacExtent extent() const
Returns the collection's spatial and temporal extent.
QStringList keywords() const
Returns the list of keywords describing the Collection.
QMap< QString, QgsStacAsset > assets() const
Returns a dictionary of asset objects in the catalog, each with a unique id key.
void setAssets(const QMap< QString, QgsStacAsset > &assets)
Sets the asset objects in the catalog, each with a unique id key.
Stores a STAC SpatioTemporal extent.
Stores data associated with a STAC link.
QString stacVersion() const
Returns the STAC version the object implements.
QString id() const
Id of the STAC object.
QVector< QgsStacLink > mLinks
QStringList mStacExtensions
QVector< QgsStacLink > links() const
Returns the STAC links included in the object.
Stores data related to a STAC provider.
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.