# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/versions.py



import logging
from qgis.core import (
    QgsFeature,
    QgsWkbTypes,
)
from safe.definitions.constants import inasafe_keyword_version_key
from safe.definitions.fields import (
    aggregation_id_field,
    aggregation_name_field,
    analysis_name_field,
    profiling_function_field,
    profiling_time_field,
    profiling_memory_field
)
from safe.definitions.layer_purposes import (
    layer_purpose_profiling,
    layer_purpose_aggregation,
    layer_purpose_analysis_impacted,
)
from safe.definitions.versions import inasafe_keyword_version
from safe.gis.vector.tools import (
    create_memory_layer, create_field_from_definition, copy_layer)
from safe.utilities.gis import qgis_version
from safe.utilities.i18n import tr
from safe.utilities.profiling import profile
from safe.utilities.settings import setting

    :param crs: The CRS to use.
    :type crs: QgsCoordinateReferenceSystem

    :param name: The name of the analysis.
    :type name: basestring

    :returns: A polygon layer with exposure's crs.
    :rtype: QgsVectorLayer
    """
    fields = [
        create_field_from_definition(analysis_name_field)
    ]
    analysis_layer = create_memory_layer(
        'analysis', QgsWkbTypes.PolygonGeometry, crs, fields)

    analysis_layer.startEditing()

    feature = QgsFeature()
    # noinspection PyCallByClass,PyArgumentList,PyTypeChecker
    feature.setGeometry(analysis_extent)
    feature.setAttributes([name])
    analysis_layer.addFeature(feature)
    analysis_layer.commitChanges()

    # Generate analysis keywords
    analysis_layer.keywords['layer_purpose'] = (
        layer_purpose_analysis_impacted['key'])
    analysis_layer.keywords['title'] = 'analysis'
    analysis_layer.keywords[inasafe_keyword_version_key] = (

# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/versions.py



# Path: safe/impact_function/create_extra_layers.py
import logging
from qgis.core import (
    QgsFeature,
    QgsWkbTypes,
)
from safe.definitions.constants import inasafe_keyword_version_key
from safe.definitions.fields import (
    aggregation_id_field,
    aggregation_name_field,
    analysis_name_field,
    profiling_function_field,
    profiling_time_field,
    profiling_memory_field
)
from safe.definitions.layer_purposes import (
    layer_purpose_profiling,
    layer_purpose_aggregation,
    layer_purpose_analysis_impacted,
)
from safe.definitions.versions import inasafe_keyword_version
from safe.gis.vector.tools import (
    create_memory_layer, create_field_from_definition, copy_layer)
from safe.utilities.gis import qgis_version
from safe.utilities.i18n import tr
from safe.utilities.profiling import profile
from safe.utilities.settings import setting


    :param crs: The CRS to use.
    :type crs: QgsCoordinateReferenceSystem

    :param name: The name of the analysis.
    :type name: basestring

    :returns: A polygon layer with exposure's crs.
    :rtype: QgsVectorLayer
    """
    fields = [
        create_field_from_definition(analysis_name_field)
    ]
    analysis_layer = create_memory_layer(
        'analysis', QgsWkbTypes.PolygonGeometry, crs, fields)

    analysis_layer.startEditing()

    feature = QgsFeature()
    # noinspection PyCallByClass,PyArgumentList,PyTypeChecker
    feature.setGeometry(analysis_extent)
    feature.setAttributes([name])
    analysis_layer.addFeature(feature)
    analysis_layer.commitChanges()

    # Generate analysis keywords
    analysis_layer.keywords['layer_purpose'] = (
        layer_purpose_analysis_impacted['key'])
    analysis_layer.keywords['title'] = 'analysis'
    analysis_layer.keywords[inasafe_keyword_version_key] = (

        inasafe_keyword_version)