safe.storage.safe_layer module

InaSAFE Disaster risk assessment tool developed by AusAid - Impact Function Base Class

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.storage.safe_layer.SafeLayer(layer, name=None)[source]

Bases: object

Wrapper for QgsMapLayer and safe.storage.layer.

is_qgsvectorlayer()[source]

Return true if self.layer is a QgsVectorLayer.

Returns:Boolean.
Return type:bool
keyword(key)[source]

Return value of key from keywords.

It will raise KeywordNotFoundError if the key is not found.

Parameters:key (str) – The key of a keyword.
Returns:The value of the key in keywords dictionary.
Return type:str, dict, int, float
keywords[source]

Property for the layer’s keywords. :returns: A keywords. :rtype: dict

layer[source]

Property for the actual layer. :returns: A map layer. :rtype: QgsMapLayer, Layer

name[source]

Property for the actual layer.

Returns:A layer’s name.
Return type:basestring
qgis_vector_layer()[source]

Get QgsVectorLayer representation of self.layer.

Returns:A QgsVectorLayer if it’s vector.
Return type:QgsVectorLayer, None