# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/layer_purposes.py



import logging
import os
import safe.gui.tools.wizard.wizard_strings
from qgis.PyQt import QtCore
from qgis.core import QgsCoordinateTransform, QgsProject
from safe.common.version import get_version
from safe.definitions.constants import RECENT, GLOBAL
from safe.definitions.layer_modes import layer_mode_classified
from safe.definitions.layer_purposes import (
    layer_geometry_line, layer_geometry_point, layer_geometry_polygon)
from safe.definitions.layer_purposes import (
    layer_purpose_exposure, layer_purpose_hazard)
from safe.utilities.default_values import get_inasafe_default_value_qsetting
from safe.utilities.gis import (
    is_raster_layer, is_point_layer, is_polygon_layer)
from safe.utilities.i18n import tr
from safe.utilities.resources import resources_path
from safe.utilities.utilities import is_keyword_version_supported
    else:
        keyword_version = None

    if (keywords
            and keyword_version
            and is_keyword_version_supported(keyword_version)):
        # The layer has valid keywords
        purpose = keywords.get('layer_purpose')
        if purpose == layer_purpose_hazard['key']:
            subcategory = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Hazard'), keywords.get(purpose))
            unit = keywords.get('continuous_hazard_unit')
        elif purpose == layer_purpose_exposure['key']:
            subcategory = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Exposure'), keywords.get(purpose))
            unit = keywords.get('exposure_unit')
        else:
            subcategory = ''
            unit = None
        if keywords.get('layer_mode') == layer_mode_classified['key']:
            unit = tr('classified data')
        if unit:
            unit = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Unit'), unit)

        description = """
            <table border="0" width="100%%">
            <tr><td><b>%s</b>: </td><td>%s</td></tr>
            <tr><td><b>%s</b>: </td><td>%s</td></tr>
            %s

# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/layer_purposes.py



# Path: safe/gui/tools/wizard/utilities.py
import logging
import os
import safe.gui.tools.wizard.wizard_strings
from qgis.PyQt import QtCore
from qgis.core import QgsCoordinateTransform, QgsProject
from safe.common.version import get_version
from safe.definitions.constants import RECENT, GLOBAL
from safe.definitions.layer_modes import layer_mode_classified
from safe.definitions.layer_purposes import (
    layer_geometry_line, layer_geometry_point, layer_geometry_polygon)
from safe.definitions.layer_purposes import (
    layer_purpose_exposure, layer_purpose_hazard)
from safe.utilities.default_values import get_inasafe_default_value_qsetting
from safe.utilities.gis import (
    is_raster_layer, is_point_layer, is_polygon_layer)
from safe.utilities.i18n import tr
from safe.utilities.resources import resources_path
from safe.utilities.utilities import is_keyword_version_supported

    else:
        keyword_version = None

    if (keywords
            and keyword_version
            and is_keyword_version_supported(keyword_version)):
        # The layer has valid keywords
        purpose = keywords.get('layer_purpose')
        if purpose == layer_purpose_hazard['key']:
            subcategory = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Hazard'), keywords.get(purpose))
            unit = keywords.get('continuous_hazard_unit')
        elif purpose == layer_purpose_exposure['key']:
            subcategory = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Exposure'), keywords.get(purpose))
            unit = keywords.get('exposure_unit')
        else:
            subcategory = ''
            unit = None
        if keywords.get('layer_mode') == layer_mode_classified['key']:
            unit = tr('classified data')
        if unit:
            unit = '<tr><td><b>%s</b>: </td><td>%s</td></tr>' % (
                tr('Unit'), unit)

        description = """
            <table border="0" width="100%%">
            <tr><td><b>%s</b>: </td><td>%s</td></tr>
            <tr><td><b>%s</b>: </td><td>%s</td></tr>
            %s

            %s