QGIS API Documentation 4.1.0-Master (31622b25bb0)
Loading...
Searching...
No Matches
qgslayermetadata.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslayermetadata.cpp
3 --------------------
4 begin : April 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include "qgslayermetadata.h"
19
20#include "qgsmaplayer.h"
22
23#include <QRegularExpression>
24#include <QString>
25
26#include "moc_qgslayermetadata.cpp"
27
28using namespace Qt::StringLiterals;
29
31{
32 return new QgsLayerMetadata( *this );
33}
34
36{
37 return mFees;
38}
39
40void QgsLayerMetadata::setFees( const QString &fees )
41{
42 mFees = fees;
43}
44
46{
47 mConstraints << constraint;
48}
49
50QList<QgsLayerMetadata::Constraint> QgsLayerMetadata::constraints() const
51{
52 return mConstraints;
53}
54
55void QgsLayerMetadata::setConstraints( const QList<Constraint> &constraints )
56{
57 mConstraints = constraints;
58}
59
60QStringList QgsLayerMetadata::rights() const
61{
62 return mRights;
63}
64
65void QgsLayerMetadata::setRights( const QStringList &rights )
66{
67 mRights = rights;
68}
69
70QStringList QgsLayerMetadata::licenses() const
71{
72 return mLicenses;
73}
74
75void QgsLayerMetadata::setLicenses( const QStringList &licenses )
76{
77 mLicenses = licenses;
78}
79
81{
82 return mEncoding;
83}
84
86{
87 mEncoding = encoding;
88}
89
94
99
101{
102 layer->setCustomProperty( u"metadata/identifier"_s, mIdentifier );
103 layer->setCustomProperty( u"metadata/parentIdentifier"_s, mParentIdentifier );
104 layer->setCustomProperty( u"metadata/language"_s, mLanguage );
105 layer->setCustomProperty( u"metadata/type"_s, mType );
106 layer->setCustomProperty( u"metadata/title"_s, mTitle );
107 layer->setCustomProperty( u"metadata/extent"_s, QVariant::fromValue( mExtent ) );
108 layer->setCustomProperty( u"metadata/abstract"_s, mAbstract );
109 layer->setCustomProperty( u"metadata/fees"_s, mFees );
110 layer->setCustomProperty( u"metadata/rights"_s, mRights );
111 layer->setCustomProperty( u"metadata/licenses"_s, mLicenses );
112 layer->setCustomProperty( u"metadata/history"_s, mHistory );
113 layer->setCustomProperty( u"metadata/encoding"_s, mEncoding );
114 layer->setCustomProperty( u"metadata/crs"_s, mCrs.authid() );
115 layer->setCustomProperty( u"metadata/constraints"_s, QVariant::fromValue( mConstraints ) );
116 layer->setCustomProperty( u"metadata/keywords"_s, QVariant::fromValue( mKeywords ) );
117 layer->setCustomProperty( u"metadata/contacts"_s, QVariant::fromValue( mContacts ) );
118 layer->setCustomProperty( u"metadata/links"_s, QVariant::fromValue( mLinks ) );
119}
120
122{
123 mIdentifier = layer->customProperty( u"metadata/identifier"_s ).toString();
124 mParentIdentifier = layer->customProperty( u"metadata/parentIdentifier"_s ).toString();
125 mLanguage = layer->customProperty( u"metadata/language"_s ).toString();
126 mType = layer->customProperty( u"metadata/type"_s ).toString();
127 mTitle = layer->customProperty( u"metadata/title"_s ).toString();
128 mAbstract = layer->customProperty( u"metadata/abstract"_s ).toString();
129 mFees = layer->customProperty( u"metadata/fees"_s ).toString();
130 mRights = layer->customProperty( u"metadata/rights"_s ).toStringList();
131 mLicenses = layer->customProperty( u"metadata/licenses"_s ).toStringList();
132 mHistory = layer->customProperty( u"metadata/history"_s ).toStringList();
133 mEncoding = layer->customProperty( u"metadata/encoding"_s ).toString();
134 const QString crsAuthId = layer->customProperty( u"metadata/crs"_s ).toString();
136 mExtent = layer->customProperty( u"metadata/extent"_s ).value<Extent>();
137 mConstraints = layer->customProperty( u"metadata/constraints"_s ).value<ConstraintList>();
138 mKeywords = layer->customProperty( u"metadata/keywords"_s ).value<QgsAbstractMetadataBase::KeywordMap>();
139 mContacts = layer->customProperty( u"metadata/contacts"_s ).value<QgsAbstractMetadataBase::ContactList>();
140 mLinks = layer->customProperty( u"metadata/links"_s ).value<QgsAbstractMetadataBase::LinkList>();
141}
142
143bool QgsLayerMetadata::readMetadataXml( const QDomElement &metadataElement, const QgsReadWriteContext &context )
144{
145 QgsAbstractMetadataBase::readMetadataXml( metadataElement, context );
146
147 QDomNode mnl;
148 QDomElement mne;
149
150 // set fees
151 mnl = metadataElement.namedItem( u"fees"_s );
152 mFees = mnl.toElement().text();
153
154 // constraints
155 const QDomNodeList constraintsList = metadataElement.elementsByTagName( u"constraints"_s );
156 mConstraints.clear();
157 for ( int i = 0; i < constraintsList.size(); i++ )
158 {
159 mnl = constraintsList.at( i );
160 mne = mnl.toElement();
161 addConstraint( QgsLayerMetadata::Constraint( mne.text(), mne.attribute( u"type"_s ) ) );
162 }
163
164 // rights
165 const QDomNodeList rightsNodeList = metadataElement.elementsByTagName( u"rights"_s );
166 QStringList rightsList;
167 for ( int i = 0; i < rightsNodeList.size(); i++ )
168 {
169 mnl = rightsNodeList.at( i );
170 mne = mnl.toElement();
171 const QString right = context.projectTranslator()->translate( "metadata", mne.text() );
172 rightsList.append( right );
173 }
174 setRights( rightsList );
175
176 // licenses
177 const QDomNodeList licensesNodeList = metadataElement.elementsByTagName( u"license"_s );
178 QStringList licensesList;
179 for ( int i = 0; i < licensesNodeList.size(); i++ )
180 {
181 mnl = licensesNodeList.at( i );
182 mne = mnl.toElement();
183 licensesList.append( mne.text() );
184 }
185 setLicenses( licensesList );
186
187 // encoding
188 mnl = metadataElement.namedItem( u"encoding"_s );
189 mEncoding = mnl.toElement().text();
190
191 // crs
192 mnl = metadataElement.namedItem( u"crs"_s );
193 if ( !mCrs.readXml( mnl ) )
195
196 // extent
197 mnl = metadataElement.namedItem( u"extent"_s );
198 QgsLayerMetadata::Extent metadataExtent;
199
200 // spatial extent
201 const QDomNodeList spatialList = mnl.toElement().elementsByTagName( u"spatial"_s );
202 QList< QgsLayerMetadata::SpatialExtent > metadataSpatialExtents;
203 for ( int i = 0; i < spatialList.size(); i++ )
204 {
205 mnl = spatialList.at( i );
206 mne = mnl.toElement();
208 se.extentCrs = QgsCoordinateReferenceSystem( mne.attribute( u"crs"_s ) );
209 se.bounds = QgsBox3D();
210 se.bounds.setXMinimum( mne.attribute( u"minx"_s ).toDouble() );
211 se.bounds.setYMinimum( mne.attribute( u"miny"_s ).toDouble() );
212 se.bounds.setZMinimum( mne.attribute( u"minz"_s ).toDouble() );
213 se.bounds.setXMaximum( mne.attribute( u"maxx"_s ).toDouble() );
214 se.bounds.setYMaximum( mne.attribute( u"maxy"_s ).toDouble() );
215 se.bounds.setZMaximum( mne.attribute( u"maxz"_s ).toDouble() );
216 metadataSpatialExtents.append( se );
217 }
218 metadataExtent.setSpatialExtents( metadataSpatialExtents );
219
220 // temporal extent
221 mnl = metadataElement.namedItem( u"extent"_s );
222 const QDomNodeList temporalList = mnl.toElement().elementsByTagName( u"temporal"_s );
223 QList<QgsDateTimeRange> metadataDates;
224 for ( int j = 0; j < temporalList.size(); j++ )
225 {
226 mnl = temporalList.at( j );
227 const QDomNodeList instantList = mnl.toElement().elementsByTagName( u"instant"_s );
228 for ( int i = 0; i < instantList.size(); i++ )
229 {
230 mnl = instantList.at( i );
231 const QDateTime d = QDateTime::fromString( mnl.toElement().text(), Qt::ISODate );
232 const QgsDateTimeRange date = QgsDateTimeRange( d, d );
233 metadataDates << date;
234 }
235 const QDomNodeList periodList = mnl.toElement().elementsByTagName( u"period"_s );
236 for ( int i = 0; i < periodList.size(); i++ )
237 {
238 const QDomNode begin = periodList.at( i ).namedItem( u"start"_s );
239 const QDomNode end = periodList.at( i ).namedItem( u"end"_s );
240 const QDateTime beginDate = QDateTime::fromString( begin.toElement().text(), Qt::ISODate );
241 const QDateTime endDate = QDateTime::fromString( end.toElement().text(), Qt::ISODate );
242 const QgsDateTimeRange date = QgsDateTimeRange( beginDate, endDate );
243 metadataDates << date;
244 }
245 }
246 metadataExtent.setTemporalExtents( metadataDates );
247 setExtent( metadataExtent );
248
249 return true;
250}
251
252bool QgsLayerMetadata::writeMetadataXml( QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context ) const
253{
254 QgsAbstractMetadataBase::writeMetadataXml( metadataElement, document, context );
255
256 // fees
257 QDomElement fees = document.createElement( u"fees"_s );
258 const QDomText feesText = document.createTextNode( mFees );
259 fees.appendChild( feesText );
260 metadataElement.appendChild( fees );
261
262 // constraints
263 for ( const QgsLayerMetadata::Constraint &constraint : mConstraints )
264 {
265 QDomElement constraintElement = document.createElement( u"constraints"_s );
266 constraintElement.setAttribute( u"type"_s, constraint.type );
267 const QDomText constraintText = document.createTextNode( constraint.constraint );
268 constraintElement.appendChild( constraintText );
269 metadataElement.appendChild( constraintElement );
270 }
271
272 // rights
273 for ( const QString &right : mRights )
274 {
275 QDomElement rightElement = document.createElement( u"rights"_s );
276 const QDomText rightText = document.createTextNode( right );
277 rightElement.appendChild( rightText );
278 metadataElement.appendChild( rightElement );
279 }
280
281 // license
282 for ( const QString &license : mLicenses )
283 {
284 QDomElement licenseElement = document.createElement( u"license"_s );
285 const QDomText licenseText = document.createTextNode( license );
286 licenseElement.appendChild( licenseText );
287 metadataElement.appendChild( licenseElement );
288 }
289
290 // encoding
291 QDomElement encoding = document.createElement( u"encoding"_s );
292 const QDomText encodingText = document.createTextNode( mEncoding );
293 encoding.appendChild( encodingText );
294 metadataElement.appendChild( encoding );
295
296 // crs
297 QDomElement crsElement = document.createElement( u"crs"_s );
298 mCrs.writeXml( crsElement, document );
299 metadataElement.appendChild( crsElement );
300
301 // extent
302 QDomElement extentElement = document.createElement( u"extent"_s );
303
304 // spatial extents
305 const QList< QgsLayerMetadata::SpatialExtent > sExtents = extent().spatialExtents();
306 for ( const QgsLayerMetadata::SpatialExtent &spatialExtent : sExtents )
307 {
308 QDomElement spatialElement = document.createElement( u"spatial"_s );
309 // Dimensions fixed in the XSD
310 spatialElement.setAttribute( u"dimensions"_s, u"2"_s );
311 spatialElement.setAttribute( u"crs"_s, spatialExtent.extentCrs.authid() );
312 spatialElement.setAttribute( u"minx"_s, qgsDoubleToString( spatialExtent.bounds.xMinimum() ) );
313 spatialElement.setAttribute( u"miny"_s, qgsDoubleToString( spatialExtent.bounds.yMinimum() ) );
314 spatialElement.setAttribute( u"minz"_s, qgsDoubleToString( spatialExtent.bounds.zMinimum() ) );
315 spatialElement.setAttribute( u"maxx"_s, qgsDoubleToString( spatialExtent.bounds.xMaximum() ) );
316 spatialElement.setAttribute( u"maxy"_s, qgsDoubleToString( spatialExtent.bounds.yMaximum() ) );
317 spatialElement.setAttribute( u"maxz"_s, qgsDoubleToString( spatialExtent.bounds.zMaximum() ) );
318 extentElement.appendChild( spatialElement );
319 }
320
321 // temporal extents
322 const QList< QgsDateTimeRange > tExtents = extent().temporalExtents();
323 for ( const QgsDateTimeRange &temporalExtent : tExtents )
324 {
325 QDomElement temporalElement = document.createElement( u"temporal"_s );
326 if ( temporalExtent.isInstant() )
327 {
328 QDomElement instantElement = document.createElement( u"instant"_s );
329 const QDomText instantText = document.createTextNode( temporalExtent.begin().toTimeSpec( Qt::OffsetFromUTC ).toString( Qt::ISODate ) );
330 instantElement.appendChild( instantText );
331 temporalElement.appendChild( instantElement );
332 }
333 else
334 {
335 QDomElement periodElement = document.createElement( u"period"_s );
336 QDomElement startElement = document.createElement( u"start"_s );
337 QDomElement endElement = document.createElement( u"end"_s );
338 const QDomText startText = document.createTextNode( temporalExtent.begin().toTimeSpec( Qt::OffsetFromUTC ).toString( Qt::ISODate ) );
339 const QDomText endText = document.createTextNode( temporalExtent.end().toTimeSpec( Qt::OffsetFromUTC ).toString( Qt::ISODate ) );
340 startElement.appendChild( startText );
341 endElement.appendChild( endText );
342 periodElement.appendChild( startElement );
343 periodElement.appendChild( endElement );
344 temporalElement.appendChild( periodElement );
345 }
346 extentElement.appendChild( temporalElement );
347 }
348
349 metadataElement.appendChild( extentElement );
350
351 return true;
352}
353
355{
357
358 for ( const QString &right : std::as_const( mRights ) )
359 {
360 translationContext->registerTranslation( u"metadata"_s, right );
361 }
362}
363
365{
367
368 if ( const QgsLayerMetadata *otherLayerMetadata = dynamic_cast< const QgsLayerMetadata * >( other ) )
369 {
370 if ( !otherLayerMetadata->fees().isEmpty() )
371 mFees = otherLayerMetadata->fees();
372
373 if ( !otherLayerMetadata->constraints().isEmpty() )
374 mConstraints = otherLayerMetadata->constraints();
375
376 if ( !otherLayerMetadata->rights().isEmpty() )
377 mRights = otherLayerMetadata->rights();
378
379 if ( !otherLayerMetadata->licenses().isEmpty() )
380 mLicenses = otherLayerMetadata->licenses();
381
382 if ( !otherLayerMetadata->encoding().isEmpty() )
383 mEncoding = otherLayerMetadata->encoding();
384
385 if ( otherLayerMetadata->crs().isValid() )
386 mCrs = otherLayerMetadata->crs();
387
388 if ( !otherLayerMetadata->extent().spatialExtents().isEmpty() )
389 mExtent.setSpatialExtents( otherLayerMetadata->extent().spatialExtents() );
390
391 if ( !otherLayerMetadata->extent().temporalExtents().isEmpty() )
392 mExtent.setTemporalExtents( otherLayerMetadata->extent().temporalExtents() );
393 }
394}
395
397{
398 return mExtent;
399}
400
402{
403 return mExtent;
404}
405
407{
408 mExtent = extent;
409}
410
411QList<QgsLayerMetadata::SpatialExtent> QgsLayerMetadata::Extent::spatialExtents() const
412{
413 return mSpatialExtents;
414}
415
416void QgsLayerMetadata::Extent::setSpatialExtents( const QList<QgsLayerMetadata::SpatialExtent> &spatialExtents )
417{
418 mSpatialExtents = spatialExtents;
419}
420
421QList<QgsDateTimeRange> QgsLayerMetadata::Extent::temporalExtents() const
422{
423 return mTemporalExtents;
424}
425
427{
428 mTemporalExtents = temporalExtents;
429}
430
432{
433 return mSpatialExtents == other.mSpatialExtents && mTemporalExtents == other.mTemporalExtents;
434}
435
437{
438 return equals( other )
439 && mFees == other.mFees
440 && mConstraints == other.mConstraints
441 && mRights == other.mRights
442 && mLicenses == other.mLicenses
443 && mEncoding == other.mEncoding
444 && mCrs == other.mCrs
445 && mExtent == other.mExtent;
446}
447
448bool QgsLayerMetadata::contains( const QString &searchString ) const
449{
450 if ( searchString.trimmed().isEmpty() )
451 {
452 return false;
453 }
454
455 if ( title().contains( searchString, Qt::CaseInsensitive ) || identifier().contains( searchString, Qt::CaseInsensitive ) || abstract().contains( searchString, Qt::CaseInsensitive ) )
456 {
457 return true;
458 }
459
460 const QList<QStringList> keyVals { keywords().values() };
461 for ( const QStringList &kws : std::as_const( keyVals ) )
462 {
463 for ( const QString &kw : std::as_const( kws ) )
464 {
465 if ( kw.contains( searchString, Qt::CaseSensitivity::CaseInsensitive ) )
466 {
467 return true;
468 }
469 }
470 }
471
472 const QStringList constCat { categories() };
473 for ( const QString &cat : std::as_const( constCat ) )
474 {
475 if ( cat.contains( searchString, Qt::CaseSensitivity::CaseInsensitive ) )
476 {
477 return true;
478 }
479 }
480
481 return false;
482}
483
484bool QgsLayerMetadata::matches( const QVector<QRegularExpression> &searchReList ) const
485{
486 for ( const QRegularExpression &re : std::as_const( searchReList ) )
487 {
488 if ( re.match( title() ).hasMatch() || re.match( identifier() ).hasMatch() || re.match( abstract() ).hasMatch() )
489 {
490 return true;
491 }
492
493 const QList<QStringList> keyVals { keywords().values() };
494 for ( const QStringList &kws : std::as_const( keyVals ) )
495 {
496 for ( const QString &kw : std::as_const( kws ) )
497 {
498 if ( re.match( kw ).hasMatch() )
499 {
500 return true;
501 }
502 }
503 }
504
505 const QStringList constCat { categories() };
506 for ( const QString &cat : std::as_const( constCat ) )
507 {
508 if ( re.match( cat ).hasMatch() )
509 {
510 return true;
511 }
512 }
513 }
514
515 return false;
516}
517
519{
520 return extentCrs == other.extentCrs && bounds == other.bounds;
521}
522
524{
525 return type == other.type && constraint == other.constraint;
526}
QgsAbstractMetadataBase::ContactList mContacts
QMap< QString, QStringList > KeywordMap
Map of vocabulary string to keyword list.
virtual void combine(const QgsAbstractMetadataBase *other)
Combines the metadata from this object with the metadata from an other object.
QStringList categories() const
Returns categories of the resource.
virtual bool writeMetadataXml(QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Stores state in a DOM node.
QgsAbstractMetadataBase::KeywordMap mKeywords
Keywords map.
QgsAbstractMetadataBase::KeywordMap keywords() const
Returns the keywords map, which is a set of descriptive keywords associated with the resource.
bool equals(const QgsAbstractMetadataBase &other) const
Tests whether the common metadata fields in this object are equal to other.
virtual void registerTranslations(QgsTranslationContext *translationContext) const
Registers metadata translation strings.
QgsAbstractMetadataBase::LinkList mLinks
QString identifier() const
A reference, URI, URL or some other mechanism to identify the resource.
QgsAbstractMetadataBase()=default
Constructor for QgsAbstractMetadataBase.
virtual bool readMetadataXml(const QDomElement &metadataElement, const QgsReadWriteContext &context=QgsReadWriteContext())
Sets state from DOM document.
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:45
void setZMinimum(double z)
Sets the minimum z value.
Definition qgsbox3d.cpp:94
void setYMaximum(double y)
Sets the maximum y value.
Definition qgsbox3d.cpp:89
void setZMaximum(double z)
Sets the maximum z value.
Definition qgsbox3d.cpp:99
void setXMaximum(double x)
Sets the maximum x value.
Definition qgsbox3d.cpp:79
void setYMinimum(double y)
Sets the minimum y value.
Definition qgsbox3d.cpp:84
void setXMinimum(double x)
Sets the minimum x value.
Definition qgsbox3d.cpp:74
Represents a coordinate reference system (CRS).
static QgsCoordinateReferenceSystem fromOgcWmsCrs(const QString &ogcCrs)
Creates a CRS from a given OGC WMS-format Coordinate Reference System string.
void addConstraint(const QgsLayerMetadata::Constraint &constraint)
Adds an individual constraint to the existing constraints.
const QgsLayerMetadata::Extent & extent() const
Returns the spatial and temporal extents associated with the resource.
void setConstraints(const QgsLayerMetadata::ConstraintList &constraints)
Sets the list of constraints associated with using the resource.
QgsLayerMetadata()=default
void setFees(const QString &fees)
Sets the fees associated with using the resource.
void setLicenses(const QStringList &licenses)
Sets a list of licenses associated with the resource.
bool operator==(const QgsLayerMetadata &metadataOther) const
QgsLayerMetadata::ConstraintList constraints() const
Returns a list of constraints associated with using the resource.
bool writeMetadataXml(QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context=QgsReadWriteContext()) const override
Stores state in a DOM node.
void setRights(const QStringList &rights)
Sets a list of rights (attribution or copyright strings) associated with the resource.
QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system described by the layer's metadata.
void setEncoding(const QString &encoding)
Sets the character encoding of the data in the resource.
QString encoding() const
Returns the character encoding of the data in the resource.
void combine(const QgsAbstractMetadataBase *other) override
Combines the metadata from this object with the metadata from an other object.
void registerTranslations(QgsTranslationContext *translationContext) const override
Registers metadata translation strings.
void readFromLayer(const QgsMapLayer *layer)
Reads the metadata state from a layer's custom properties (see QgsMapLayer::customProperty() ).
void saveToLayer(QgsMapLayer *layer) const
Saves the metadata to a layer's custom properties (see QgsMapLayer::setCustomProperty() ).
QgsLayerMetadata * clone() const override
Clones the metadata object.
void setExtent(const QgsLayerMetadata::Extent &extent)
Sets the spatial and temporal extents associated with the resource.
bool readMetadataXml(const QDomElement &metadataElement, const QgsReadWriteContext &context=QgsReadWriteContext()) override
Sets state from DOM document.
bool matches(const QVector< QRegularExpression > &searchReList) const
Returns true if the metadata identifier, title, abstract, keywords or categories matches any regular ...
bool contains(const QString &searchString) const
Returns true if the metadata identifier, title, abstract, keywords or categories contain searchString...
QList< QgsLayerMetadata::Constraint > ConstraintList
A list of constraints.
QString fees() const
Returns any fees associated with using the resource.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the coordinate reference system for the layer's metadata.
Base class for all map layer types.
Definition qgsmaplayer.h:83
Q_INVOKABLE QVariant customProperty(const QString &value, const QVariant &defaultValue=QVariant()) const
Read a custom property from layer.
Q_INVOKABLE void setCustomProperty(const QString &key, const QVariant &value)
Set a custom property for layer.
virtual QString translate(const QString &context, const QString &sourceText, const char *disambiguation=nullptr, int n=-1) const =0
Translates a string using the Qt QTranslator mechanism.
A container for the context for various read/write operations on objects.
const QgsProjectTranslator * projectTranslator() const
Returns the project translator.
Used for the collecting of strings from projects for translation and creation of ts files.
void registerTranslation(const QString &context, const QString &source)
Registers the source to be translated.
QList< QgsAbstractMetadataBase::Link > LinkList
A list of links.
QList< QgsAbstractMetadataBase::Contact > ContactList
A list of contacts.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition qgis.h:7140
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:705
Metadata constraint structure.
bool operator==(const QgsLayerMetadata::Constraint &other) const
QString constraint
Free-form constraint string.
QString type
Constraint type.
Metadata extent structure.
QList< QgsLayerMetadata::SpatialExtent > spatialExtents() const
Spatial extents of the resource.
void setSpatialExtents(const QList< QgsLayerMetadata::SpatialExtent > &extents)
Sets the spatial extents of the resource.
bool operator==(const QgsLayerMetadata::Extent &other) const
void setTemporalExtents(const QList< QgsDateTimeRange > &extents)
Sets the temporal extents of the resource.
QList< QgsDateTimeRange > temporalExtents() const
Temporal extents of the resource.
Metadata spatial extent structure.
QgsCoordinateReferenceSystem extentCrs
Coordinate reference system for spatial extent.
QgsBox3D bounds
Geospatial extent of the resource.
bool operator==(const QgsLayerMetadata::SpatialExtent &other) const