safe.metadata.impact_layer_metadata module

InaSAFE Disaster risk assessment tool developed by AusAid - metadata module.

Contact :


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.metadata.impact_layer_metadata.ImpactLayerMetadata(layer_uri, xml_uri=None, json_uri=None)[source]

Bases: safe.metadata.base_metadata.BaseMetadata

Metadata class for impact layers

if you need to add a standard XML property that only applies to this subclass, do it this way. @property and @propname.setter will be generated automatically

_standard_properties = {
‘TESTprop’: (
‘gmd:identificationInfo/’ ‘gmd:MD_DataIdentification/’ ‘gmd:supplementalInformation/’ ‘gco:CharacterString’)

} from safe.metadata.utils import merge_dictionaries _standard_properties = merge_dictionaries(

BaseMetadata._standard_properties, _standard_properties)

New in version 3.2.

append_provenance_step(title, description, timestamp=None)[source]

Add a step to the provenance of the metadata

  • title (str) – the title of the step
  • description (str) – the content of the step
  • timestamp (datetime) – the time of the step

calls the overridden method and adds provenance and summary data

Returns:dictionary representation of the metadata
Return type:dict

json representation of the metadata

Returns:json representation of the metadata
Return type:str

Get the provenance elements of the metadata

there is no setter as provenance can only grow. use append_provenance_step to add steps

Returns:The provenance element
Return type:Provenance

read metadata from json and set all the found properties.

Returns:the read metadata
Return type:dict

read metadata from xml and set all the found properties.

Returns:the root element of the xml
Return type:ElementTree.Element

xml representation of the metadata.

Returns:xml representation of the metadata
Return type:ElementTree.Element