def as_dict():
        """Return metadata as a dictionary.

        This is a static method. You can use it to get the metadata in
        dictionary format for an impact function.

        :returns: A dictionary representing all the metadata for the
            concrete impact function.
        :rtype: dict
        """
        dict_meta = {
            'id': 'ClassifiedRasterHazardBuildingFunction',
            'name': tr('Classified raster hazard on buildings'),
            'impact': tr('Be impacted'),
            'title': tr('Be impacted in each hazard class'),
            'function_type': 'old-style',
            'author': 'Dianne Bencito',
            'date_implemented': 'N/A',
            'overview': tr(
                'To assess the impacts of a classified hazard in raster '
                'format on a buildings vector layer.'),
            'detailed_description': tr(
                'This function will treat the values in the hazard raster '
                'layer as classes representing low, medium and high '
                'impact. You need to ensure that the keywords for the hazard '
                'layer have been set appropriately to define these classes.'
                'The number of buildings that will be impacted will be '
                'calculated for each class. The report will show the total '
                'number of buildings that will be affected for each '
                'hazard class.'),
            'hazard_input': tr(
                'A hazard raster layer where each cell represents the '
                'class of the hazard. There should be 3 classes: e.g. '
                '1, 2, and 3.'),
            'exposure_input': tr(
                'A vector polygon layer which can be extracted from OSM '
                'where each polygon represents the footprint of a '
                'building.'),
            'output': tr(
                'The impact layer will contain all structures that were '
                'exposed to the highest class (3) and a summary table '
                'containing the number of structures in each class.'),
            'actions': tr(
                'Provide details about the number of buildings that are '
                'within each hazard class.'),
            'limitations': [tr('The number of classes is three.')],
            'citations': [],
            'legend_notes': '',
            'map_title': tr('Buildings affected'),
            'legend_units': tr('(Low, Medium, High)'),
            'legend_title': tr('Structure inundated status'),
            'layer_name': tr('Estimated buildings affected'),
            'layer_requirements': {
                'hazard': {
                    'layer_mode': layer_mode_classified,
                    'layer_geometries': [layer_geometry_raster],
                    'hazard_categories': [
                        hazard_category_single_event,
                        hazard_category_multiple_event
                    ],
                    'hazard_types': hazard_all,
                    'continuous_hazard_units': [],
                    'vector_hazard_classifications': [],
                    'raster_hazard_classifications': [
                        generic_raster_hazard_classes
                    ],
                    'additional_keywords': []
                },
                'exposure': {
                    'layer_mode': layer_mode_classified,
                    'layer_geometries': [
                        layer_geometry_point,
                        layer_geometry_polygon
                    ],
                    'exposure_types': [exposure_structure],
                    'exposure_units': [],
                    'exposure_class_fields': [structure_class_field],
                    'additional_keywords': []
                }
            },
            # parameters
            'parameters': OrderedDict([
                ('Categorical hazards', categorical_hazards()),
                ('postprocessors', OrderedDict([
                    ('BuildingType', building_type_postprocessor())
                ]))
            ])
        }
        return dict_meta
    def as_dict():
        """Return metadata as a dictionary.

        This is a static method. You can use it to get the metadata in
        dictionary format for an impact function.

        :returns: A dictionary representing all the metadata for the
            concrete impact function.
        :rtype: dict
        """
        dict_meta = {
            'id': 'ClassifiedRasterHazardPopulationFunction',
            'name': tr('Classified raster hazard on population'),
            'impact': tr('Be affected in each class'),
            'title': tr('Be affected in each hazard class'),
            'function_type': 'old-style',
            'author': 'Dianne Bencito',
            'date_implemented': 'N/A',
            'overview': tr(
                'To assess the impacts of classified hazards in raster '
                'format on a population raster layer.'),
            'detailed_description': tr(
                'This function will treat the values in the hazard raster '
                'layer as classes representing low, medium and high '
                'impact. You need to ensure that the keywords for the hazard '
                'layer have been set appropriately to define these classes.'
                'The number of people that will be affected will be '
                'calculated for each class. The report will show the total '
                'number of people that will be affected for each '
                'hazard class.'),
            'hazard_input': tr(
                'A hazard raster layer where each cell represents the '
                'class of the hazard. There should be three classes: e.g. '
                '1, 2, and 3.'),
            'exposure_input': tr(
                'An exposure raster layer where each cell represents the'
                'population count for that cell.'),
            'output': tr(
                'Map of population exposed to the highest class and a table '
                'with the number of people in each class'),
            'actions': tr(
                'Provide details about how many people would likely be '
                'affected for each hazard class.'),
            'limitations': [tr('The number of classes is three.')],
            'citations': [],
            'layer_requirements': {
                'hazard': {
                    'layer_mode': layer_mode_classified,
                    'layer_geometries': [layer_geometry_raster],
                    'hazard_categories': [
                        hazard_category_single_event,
                        hazard_category_multiple_event
                    ],
                    'hazard_types': hazard_all,
                    'continuous_hazard_units': [],
                    'vector_hazard_classifications': [],
                    'raster_hazard_classifications': [
                        generic_raster_hazard_classes
                    ],
                    'additional_keywords': []
                },
                'exposure': {
                    'layer_mode': layer_mode_continuous,
                    'layer_geometries': [layer_geometry_raster],
                    'exposure_types': [exposure_population],
                    'exposure_units': [
                        count_exposure_unit, density_exposure_unit],
                    'exposure_class_fields': [],
                    'additional_keywords': []
                }
            },
            'parameters': OrderedDict([
                ('Categorical hazards', categorical_hazards()),
                ('postprocessors', OrderedDict([
                    ('Gender', default_gender_postprocessor()),
                    ('Age', age_postprocessor()),
                    ('MinimumNeeds', minimum_needs_selector()),
                ])),
                ('minimum needs', default_minimum_needs())
            ])
        }
        return dict_meta
Example #3
0
    def as_dict():
        """Return metadata as a dictionary.

        This is a static method. You can use it to get the metadata in
        dictionary format for an impact function.

        :returns: A dictionary representing all the metadata for the
            concrete impact function.
        :rtype: dict
        """
        dict_meta = {
            'id':
            'ClassifiedRasterHazardPopulationFunction',
            'name':
            tr('Classified raster hazard on population'),
            'impact':
            tr('Be affected'),
            'title':
            tr('Be affected'),
            'function_type':
            'old-style',
            'author':
            'Dianne Bencito',
            'date_implemented':
            'N/A',
            'overview':
            tr('To assess the impacts of classified hazards in raster '
               'format on a population raster layer.'),
            'detailed_description':
            tr('This function will treat the values in the hazard raster '
               'layer as classes representing low, medium and high '
               'impact. You need to ensure that the keywords for the hazard '
               'layer have been set appropriately to define these classes.'
               'The number of people that will be affected will be '
               'calculated for each class. The report will show the total '
               'number of people that will be affected for each '
               'hazard class.'),
            'hazard_input':
            tr('A hazard raster layer where each cell represents the '
               'class of the hazard. There should be three classes: e.g. '
               '1, 2, and 3.'),
            'exposure_input':
            tr('An exposure raster layer where each cell represents the '
               'population count for that cell.'),
            'output':
            tr('Map of population exposed to the highest class and a table '
               'with the number of people in each class'),
            'actions':
            tr('Provide details about how many people would likely be '
               'affected for each hazard class.'),
            'limitations': [tr('The number of classes is three.')],
            'citations': [{
                'text': None,
                'link': None
            }],
            'legend_title':
            tr('Number of People'),
            'legend_units':
            tr('(people per cell)'),
            'legend_notes':
            tr('Thousand separator is represented by %s' %
               get_thousand_separator()),
            'layer_requirements': {
                'hazard': {
                    'layer_mode':
                    layer_mode_classified,
                    'layer_geometries': [layer_geometry_raster],
                    'hazard_categories': [
                        hazard_category_single_event,
                        hazard_category_multiple_event
                    ],
                    'hazard_types':
                    hazard_all,
                    'continuous_hazard_units': [],
                    'vector_hazard_classifications': [],
                    'raster_hazard_classifications':
                    [generic_raster_hazard_classes],
                    'additional_keywords': []
                },
                'exposure': {
                    'layer_mode': layer_mode_continuous,
                    'layer_geometries': [layer_geometry_raster],
                    'exposure_types': [exposure_population],
                    'exposure_units':
                    [count_exposure_unit, density_exposure_unit],
                    'exposure_class_fields': [],
                    'additional_keywords': []
                }
            },
            'parameters':
            OrderedDict([('Categorical hazards', categorical_hazards()),
                         ('postprocessors',
                          OrderedDict([
                              ('Gender', default_gender_postprocessor()),
                              ('Age', age_postprocessor()),
                              ('MinimumNeeds', minimum_needs_selector()),
                          ])), ('minimum needs', default_minimum_needs())])
        }
        return dict_meta
Example #4
0
    def as_dict():
        """Return metadata as a dictionary.

        This is a static method. You can use it to get the metadata in
        dictionary format for an impact function.

        :returns: A dictionary representing all the metadata for the
            concrete impact function.
        :rtype: dict
        """
        dict_meta = {
            'id':
            'ClassifiedRasterHazardBuildingFunction',
            'name':
            tr('Classified raster hazard on buildings'),
            'impact':
            tr('Be impacted'),
            'title':
            tr('Be impacted in each hazard class'),
            'function_type':
            'old-style',
            'author':
            'Dianne Bencito',
            'date_implemented':
            'N/A',
            'overview':
            tr('To assess the impacts of a classified hazard in raster '
               'format on a buildings vector layer.'),
            'detailed_description':
            tr('This function will treat the values in the hazard raster '
               'layer as classes representing low, medium and high '
               'impact. You need to ensure that the keywords for the hazard '
               'layer have been set appropriately to define these classes.'
               'The number of buildings that will be impacted will be '
               'calculated for each class. The report will show the total '
               'number of buildings that will be affected for each '
               'hazard class.'),
            'hazard_input':
            tr('A hazard raster layer where each cell represents the '
               'class of the hazard. There should be 3 classes: e.g. '
               '1, 2, and 3.'),
            'exposure_input':
            tr('A vector polygon layer which can be extracted from OSM '
               'where each polygon represents the footprint of a '
               'building.'),
            'output':
            tr('The impact layer will contain all structures that were '
               'exposed to the highest class (3) and a summary table '
               'containing the number of structures in each class.'),
            'actions':
            tr('Provide details about the number of buildings that are '
               'within each hazard class.'),
            'limitations': [tr('The number of classes is three.')],
            'citations': [],
            'layer_requirements': {
                'hazard': {
                    'layer_mode':
                    layer_mode_classified,
                    'layer_geometries': [layer_geometry_raster],
                    'hazard_categories': [
                        hazard_category_single_event,
                        hazard_category_multiple_event
                    ],
                    'hazard_types':
                    hazard_all,
                    'continuous_hazard_units': [],
                    'vector_hazard_classifications': [],
                    'raster_hazard_classifications':
                    [generic_raster_hazard_classes],
                    'additional_keywords': []
                },
                'exposure': {
                    'layer_mode':
                    layer_mode_classified,
                    'layer_geometries':
                    [layer_geometry_point, layer_geometry_polygon],
                    'exposure_types': [exposure_structure],
                    'exposure_units': [],
                    'exposure_class_fields': [structure_class_field],
                    'additional_keywords': []
                }
            },
            # parameters
            'parameters':
            OrderedDict([('Categorical hazards', categorical_hazards()),
                         ('postprocessors',
                          OrderedDict([('BuildingType',
                                        building_type_postprocessor())]))])
        }
        return dict_meta