safe.metadata.generic_layer_metadata module

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

Contact : ole.moller.nielsen@gmail.com

Note

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.generic_layer_metadata.GenericLayerMetadata(layer_uri, xml_uri=None, json_uri=None)[source]

Bases: safe.metadata.base_metadata.BaseMetadata

Base class for generic layers such as hazard, exposure and aggregation.

This class can be subclassed so you can create only a minimal concrete class that implements only _standard_properties to add specific properties. You can also add a standard XML property that applies to all subclasses here. In both cases do it as explained below. @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(

# change BaseMetadata to GenericLayerMetadata in subclasses BaseMetadata._standard_properties, _standard_properties)

New in version 3.2.

dict[source]

calls the overridden method

Returns:dictionary representation of the metadata
Return type:dict
json[source]

calls the overridden method

Returns:json representation of the metadata
Return type:str
read_json()[source]

calls the overridden method

Returns:the read metadata
Return type:dict
read_xml()[source]

calls the overridden method

Returns:the read metadata
Return type:ElementTree.Element
update_report()[source]

update the report.

xml[source]

calls the overridden method

Returns:xml representation of the metadata
Return type:str