QGIS/python/core/metadata/qgslayermetadata.sip.in

288 lines
8.7 KiB
Plaintext
Raw Normal View History

2017-04-10 11:02:20 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/metadata/qgslayermetadata.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2018-03-19 15:57:58 +10:00
class QgsLayerMetadata : QgsAbstractMetadataBase
2017-04-10 11:02:20 +10:00
{
%Docstring
A structured metadata store for a map layer.
2017-12-15 10:36:55 -04:00
QgsLayerMetadata handles storage and management of the metadata
for a QgsMapLayer. This class is an internal QGIS format with a common
metadata structure, which allows for code to access the metadata properties for
layers in a uniform way.
2017-12-15 10:36:55 -04:00
The metadata store is designed to be compatible with the Dublin Core metadata
specifications, and will be expanded to allow compatibility with ISO specifications
in future releases. However, the QGIS internal schema does not represent a superset
of all existing metadata schemas and accordingly conversion from specific
metadata formats to QgsLayerMetadata may result in a loss of information.
2017-12-15 10:36:55 -04:00
This class is designed to follow the specifications detailed in
the schema definition available at resources/qgis-resource-metadata.xsd
within the QGIS source code.
2017-12-15 10:36:55 -04:00
Metadata can be validated through the use of QgsLayerMetadataValidator
subclasses. E.g. validating against the native QGIS metadata schema can be performed
using QgsNativeMetadataValidator.
.. versionadded:: 3.0
%End
2017-04-10 11:02:20 +10:00
%TypeHeaderCode
#include "qgslayermetadata.h"
%End
public:
struct SpatialExtent
{
QgsCoordinateReferenceSystem extentCrs;
QgsBox3d bounds;
bool operator==( const QgsLayerMetadata::SpatialExtent &other ) const;
};
struct Extent
{
public:
QList< QgsLayerMetadata::SpatialExtent > spatialExtents() const;
%Docstring
2017-12-15 10:36:55 -04:00
Spatial extents of the resource.
.. seealso:: :py:func:`setSpatialExtents`
%End
void setSpatialExtents( const QList< QgsLayerMetadata::SpatialExtent > &extents );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the spatial ``extents`` of the resource.
.. seealso:: :py:func:`spatialExtents`
%End
QList< QgsDateTimeRange > temporalExtents() const;
%Docstring
2017-12-15 10:36:55 -04:00
Temporal extents of the resource. Use QgsDateTimeRange.isInstant() to determine
whether the temporal extent is a range or a single point in time.
If QgsDateTimeRange.isInfinite() returns true then the temporal extent
is considered to be indeterminate and continuous.
.. seealso:: :py:func:`setTemporalExtents`
%End
void setTemporalExtents( const QList< QgsDateTimeRange > &extents );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the temporal ``extents`` of the resource.
.. seealso:: :py:func:`temporalExtents`
%End
2018-02-20 11:31:33 +10:00
bool operator==( const QgsLayerMetadata::Extent &other ) const;
};
struct Constraint
{
Constraint( const QString &constraint = QString(), const QString &type = QString() );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for Constraint.
%End
QString type;
QString constraint;
bool operator==( const QgsLayerMetadata::Constraint &other ) const;
};
typedef QList< QgsLayerMetadata::Constraint > ConstraintList;
2017-04-10 11:02:20 +10:00
QgsLayerMetadata();
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayerMetadata.
%End
2017-04-10 11:02:20 +10:00
QString fees() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns any fees associated with using the resource.
An empty string will be returned if no fees are set.
.. seealso:: :py:func:`setFees`
2017-04-10 11:02:20 +10:00
%End
2017-04-10 11:02:20 +10:00
void setFees( const QString &fees );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``fees`` associated with using the resource.
Use an empty string if no fees are set.
.. seealso:: :py:func:`fees`
%End
2017-04-10 11:02:20 +10:00
QgsLayerMetadata::ConstraintList constraints() const;
2017-04-10 11:02:20 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of constraints associated with using the resource.
.. seealso:: :py:func:`setConstraints`
%End
2017-09-08 08:20:10 +02:00
void addConstraint( const QgsLayerMetadata::Constraint &constraint );
%Docstring
2017-12-15 10:36:55 -04:00
Adds an individual constraint to the existing constraints.
.. seealso:: :py:func:`constraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setConstraints`
2017-09-08 08:20:10 +02:00
%End
void setConstraints( const QgsLayerMetadata::ConstraintList &constraints );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the list of ``constraints`` associated with using the resource.
.. seealso:: :py:func:`constraints`
2017-04-10 11:02:20 +10:00
%End
QStringList rights() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of attribution or copyright strings associated with the resource.
.. seealso:: :py:func:`setRights`
2017-04-10 11:02:20 +10:00
%End
2017-04-10 11:02:20 +10:00
void setRights( const QStringList &rights );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a list of ``rights`` (attribution or copyright strings) associated with the resource.
.. seealso:: :py:func:`rights`
%End
2017-04-10 11:02:20 +10:00
2017-04-18 16:26:01 +10:00
QStringList licenses() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of licenses associated with the resource (examples: http://opendefinition.org/licenses/).
.. seealso:: :py:func:`setLicenses`
2017-04-18 16:26:01 +10:00
%End
void setLicenses( const QStringList &licenses );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a list of ``licenses`` associated with the resource.
(examples: http://opendefinition.org/licenses/).
.. seealso:: :py:func:`licenses`
2017-04-18 16:35:50 +10:00
%End
2017-04-10 11:02:20 +10:00
QString encoding() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the character encoding of the data in the resource. An empty string will be returned if no encoding is set.
.. seealso:: :py:func:`setEncoding`
2017-04-10 11:02:20 +10:00
%End
2017-04-10 11:02:20 +10:00
void setEncoding( const QString &encoding );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the character ``encoding`` of the data in the resource. Use an empty string if no encoding is set.
.. seealso:: :py:func:`encoding`
%End
QgsLayerMetadata::Extent &extent();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the spatial and temporal extents associated with the resource.
.. seealso:: :py:func:`setExtent`
%End
void setExtent( const QgsLayerMetadata::Extent &extent );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the spatial and temporal extents associated with the resource.
.. seealso:: :py:func:`setExtent`
%End
QgsCoordinateReferenceSystem crs() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the coordinate reference system described by the layer's metadata.
2017-12-19 11:43:52 -04:00
Note that this has no link to :py:func:`QgsMapLayer.crs()` While in most cases these
2017-12-15 10:36:55 -04:00
two systems are likely to be identical, it is possible to have a layer
with a different CRS described by it's accompanying metadata versus the
CRS which is actually used to display and manipulate the layer within QGIS.
This may be the case when a layer has an incorrect CRS within its metadata
and a user has manually overridden the layer's CRS within QGIS.
2017-12-20 12:10:33 +01:00
The CRS described here should either match the CRS from the layer :py:func:`QgsMapLayer.crs()`
or the CRS from the data provider.
This property should also match the CRS property used in the spatial extent.
.. seealso:: :py:func:`setCrs`
%End
void setCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the coordinate reference system for the layer's metadata.
2017-12-19 11:43:52 -04:00
Note that this has no link to :py:func:`QgsMapLayer.setCrs()` Setting the layer's
2017-12-15 10:36:55 -04:00
CRS via QgsMapLayer.setCrs() does not affect the layer's metadata CRS,
and changing the CRS from the metadata will not change the layer's
CRS or how it is projected within QGIS.
While ideally these two systems are likely to be identical, it is possible to have a layer
with a different CRS described by it's accompanying metadata versus the
CRS which is actually used to display and manipulate the layer within QGIS.
This may be the case when a layer has an incorrect CRS within its metadata
and a user has manually overridden the layer's CRS within QGIS.
2017-12-20 12:10:33 +01:00
The CRS described here should either match the CRS from the layer :py:func:`QgsMapLayer.crs()`
or the CRS from the data provider.
This property should also match the CRS property used in the spatial extent.
.. seealso:: :py:func:`crs`
%End
2017-04-10 11:02:20 +10:00
void saveToLayer( QgsMapLayer *layer ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Saves the metadata to a ``layer``'s custom properties (see QgsMapLayer.setCustomProperty() ).
.. seealso:: :py:func:`readFromLayer`
%End
void readFromLayer( const QgsMapLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Reads the metadata state from a ``layer``'s custom properties (see QgsMapLayer.customProperty() ).
.. seealso:: :py:func:`saveToLayer`
%End
2018-03-19 15:57:58 +10:00
virtual bool readMetadataXml( const QDomElement &metadataElement );
2017-12-15 21:36:08 -04:00
2018-03-19 15:57:58 +10:00
virtual bool writeMetadataXml( QDomElement &metadataElement, QDomDocument &document ) const;
2017-09-08 08:20:10 +02:00
bool operator==( const QgsLayerMetadata &metadataOther ) const;
2017-04-10 11:02:20 +10:00
};
2017-04-10 11:02:20 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/metadata/qgslayermetadata.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/