Skip to content
Browse files
Merge pull request #5165 from Gustry/save_metadata
write metadata with XML
  • Loading branch information
nyalldawson committed Sep 12, 2017
2 parents 457709d + 814ef78 commit b26b8d9
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 11 deletions.
@@ -382,6 +382,13 @@ class QgsLayerMetadata
:rtype: QgsLayerMetadata.ConstraintList

void addConstraint( const QgsLayerMetadata::Constraint &constraint );
Adds an individual constraint to the existing constraints.
.. seealso:: constraints()
.. seealso:: setConstraints()

void setConstraints( const QgsLayerMetadata::ConstraintList &constraints );
Sets the list of ``constraints`` associated with using the resource.
@@ -641,6 +648,25 @@ class QgsLayerMetadata
.. seealso:: saveToLayer()

bool readMetadataXml( const QDomElement &metadataElement );
Sets state from Dom document
\param metadataElement The Dom element corresponding to ``resourceMetadata'' tag

:return: true if successful
:rtype: bool

bool writeMetadataXml( QDomElement &metadataElement, QDomDocument &document ) const;
Stores state in Dom node
\param metadataElement is a Dom element corresponding to ``resourceMetadata'' tag
\param document is a the dom document being written

:return: true if successful
:rtype: bool


@@ -15,13 +15,21 @@
<constraints type="access">None</constraints>
<constraints type="other">None</constraints>
<rights>Copyright foo 2017</rights>
<license>License 1</license>
<license>License 2</license>
<spatial dimensions="2" crs="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90"/>
<spatial dimensions="2" crs="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90" minz="10" maxz="50"/>
@@ -46,4 +54,6 @@
<link name="geonode:roads" type="OGC:WFS" description="my GeoNode road layer" url=""/>
<link name="roads" type="WWW:LINK" description="full dataset download" url="" format="ESRI Shapefile" mimeType="application/gzip" size="283676"/>
@@ -84,7 +84,7 @@
<xs:element name="license" type="xs:string" minOccurs="1" maxOccurs="unbounded">
<xs:documentation>License associated with a given resource (examples:</xs:documentation>
<xs:element name="encoding" type="xs:string" minOccurs="0">
@@ -122,7 +122,7 @@
<xs:documentation>Freeform description of the history or lineage of the resource.</xs:documentation>
<xs:attribute name="version" use="required" fixed="1.0">
@@ -339,11 +339,11 @@
<xs:attributeGroup ref="rm:linkAttrs"/>
<xs:attributeGroup name="linkAttrs">
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="url" type="xs:anyURI" use="required"/>
<xs:attribute name="format" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="format" type="xs:string" use="optional"/>
<xs:attribute name="mimeType" type="xs:string" use="optional"/>
<xs:attribute name="size" type="xs:string" use="optional"/>

0 comments on commit b26b8d9

Please sign in to comment.