20using namespace Qt::StringLiterals;
39 QString html = u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Item"_L1 );
40 html +=
"<table class=\"list-view\">\n"_L1;
41 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"id"_s,
id() );
42 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"stac_version"_s,
stacVersion() );
43 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"collection"_s,
collection() );
44 html +=
"</table>\n"_L1;
48 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Extensions"_L1 );
52 html += u
"<li>%1</li>\n"_s.arg( extension );
57 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Geometry"_L1 );
58 html +=
"<table class=\"list-view\">\n"_L1;
59 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"WKT"_s, mGeometry.asWkt() );
60 html +=
"</table>\n"_L1;
62 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Bounding Box"_L1 );
64 html += u
"<li>%1</li>\n"_s.arg( mBbox.is2d() ? mBbox.toRectangle().toString() : mBbox.toString() );
67 if ( !mProperties.isEmpty() )
69 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Properties"_L1 );
70 html +=
"<table class=\"list-view\">\n"_L1;
71 for (
auto it = mProperties.constBegin(); it != mProperties.constEnd(); ++it )
73 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( it.key(), it.value().toString() );
75 html +=
"</table><br/>\n"_L1;
78 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Links"_L1 );
81 html +=
"<table class=\"list-view\">\n"_L1;
82 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"relation"_s, link.relation() );
83 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"title"_s, link.title() );
84 html += u
"<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n"_s.arg( u
"url"_s, link.href() );
85 html += u
"<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n"_s.arg( u
"type"_s, link.mediaType() );
86 html +=
"</table><br/>\n"_L1;
89 if ( !mAssets.isEmpty() )
91 html += u
"<h1>%1</h1>\n<hr>\n"_s.arg(
"Assets"_L1 );
92 for (
auto it = mAssets.constBegin(); it != mAssets.constEnd(); ++it )
94 html += it->toHtml( it.key() );
152 return QDateTime::fromString( mProperties.value( u
"datetime"_s, u
"null"_s ).toString() );
157 return mProperties.contains( u
"start_datetime"_s ) && mProperties.contains( u
"end_datetime"_s );
162 const QDateTime start = QDateTime::fromString( mProperties.value( u
"start_datetime"_s, u
"null"_s ).toString() );
163 const QDateTime end = QDateTime::fromString( mProperties.value( u
"end_datetime"_s, u
"null"_s ).toString() );
169 return mProperties.value( u
"title"_s ).toString();
174 return mProperties.value( u
"description"_s ).toString();
180 for (
const QgsStacAsset &asset : std::as_const( mAssets ) )
185 if ( uri.
uri.isEmpty() )
StacObjectType
Available types of stac objects.
A 3-dimensional box composed of x, y, z coordinates.
A geometry is the spatial representation of a feature.
QList< QgsMimeDataUtils::Uri > UriList
Stores data associated with a STAC asset.
QMap< QString, QgsStacAsset > assets() const
Returns a dictionary of asset objects, each with a unique key.
QString title() const
Returns an optional human readable title describing the Item.
QgsBox3D boundingBox() const
Returns the STAC item's spatial extent in WGS84 coordinates.
QgsMimeDataUtils::UriList uris() const
Returns a list of uris of all assets that have a cloud optimized format like COG or COPC.
QString description() const
Returns a Detailed multi-line description to fully explain the Item.
bool hasDateTimeRange() const
Returns true if a temporal interval is available for this item, false if a single QDateTime is availa...
QgsDateTimeRange dateTimeRange() const
Returns the temporal interval stored in the item's properties().
void setAssets(const QMap< QString, QgsStacAsset > &assets)
Sets the asset objects, each with a unique key.
void setProperties(const QVariantMap &properties)
Sets the item's additional metadata to properties.
QString collection() const
Returns the id of the STAC Collection this Item references to.
QDateTime dateTime() const
Returns the single nominal date/time for the item, stored in the item's properties().
QString toHtml() const override
Returns an HTML representation of the STAC object.
QVariantMap properties() const
Returns a dictionary of additional metadata for the Item.
QgsGeometry geometry() const
Returns the full footprint of the asset represented by this item, in WGS84.
QgsStacItem()=delete
Default constructor deleted, use the variant with required parameters.
Qgis::StacObjectType type() const override
Returns the Type of the STAC object.
void setBoundingBox(const QgsBox3D &bbox)
Sets the STAC item's spatial extent in WGS84 coordinates to bbox.
void setCollection(const QString &collection)
Sets the id of the STAC Collection this Item references to.
void setGeometry(const QgsGeometry &geometry)
Sets the full footprint of the asset represented by this item, in WGS84.
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
QgsStacObject()=delete
Default constructor is used for creating invalid objects.
QStringList mStacExtensions
QVector< QgsStacLink > links() const
Returns the STAC links included in the object.
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
QString uri
Identifier of the data source recognized by its providerKey.