# Path: safe/definitions/layer_purposes.py



import logging
import os
from safe.definitions.exposure import exposure_place
from safe.definitions.hazard import hazard_earthquake
from safe.definitions.layer_purposes import (
    layer_purpose_exposure,
    layer_purpose_hazard,
    layer_purpose_nearby_places,
    layer_purpose,
    layer_purpose_earthquake_contour,
)
from safe.gis.raster.contour import create_smooth_contour
from safe.processors import (
    function_process,
)
from safe.utilities.gis import is_raster_layer
from safe.utilities.i18n import tr
    from safe.test.utilities import load_test_vector_layer
        from safe.gis.tools import load_layer
def fake_nearby_preprocessor(impact_function):
    """Fake nearby preprocessor.

    We can put here the function to generate contours or nearby places.

    It must return a layer with a specific layer_purpose.

    :return: The output layer.
    :rtype: QgsMapLayer
    """
    _ = impact_function  # NOQA
    fake_layer = load_test_vector_layer(
        'gisv4',
        'impacts',
        'building-points-classified-vector.geojson',
        clone_to_memory=True)
    return fake_layer


pre_processors_nearby_places = {
    'key': 'pre_processor_nearby_places',
    'name': tr('Nearby Places Pre Processor'),
    'description': tr('A fake pre processor.'),
    'condition': check_nearby_preprocessor,
    'process': {
        'type': function_process,
        'function': fake_nearby_preprocessor,
    },
    'output': {
        'type': 'layer',

# Path: safe/definitions/layer_purposes.py



# Path: safe/processors/pre_processors.py
import logging
import os
from safe.definitions.exposure import exposure_place
from safe.definitions.hazard import hazard_earthquake
from safe.definitions.layer_purposes import (
    layer_purpose_exposure,
    layer_purpose_hazard,
    layer_purpose_nearby_places,
    layer_purpose,
    layer_purpose_earthquake_contour,
)
from safe.gis.raster.contour import create_smooth_contour
from safe.processors import (
    function_process,
)
from safe.utilities.gis import is_raster_layer
from safe.utilities.i18n import tr
    from safe.test.utilities import load_test_vector_layer
        from safe.gis.tools import load_layer

def fake_nearby_preprocessor(impact_function):
    """Fake nearby preprocessor.

    We can put here the function to generate contours or nearby places.

    It must return a layer with a specific layer_purpose.

    :return: The output layer.
    :rtype: QgsMapLayer
    """
    _ = impact_function  # NOQA
    fake_layer = load_test_vector_layer(
        'gisv4',
        'impacts',
        'building-points-classified-vector.geojson',
        clone_to_memory=True)
    return fake_layer


pre_processors_nearby_places = {
    'key': 'pre_processor_nearby_places',
    'name': tr('Nearby Places Pre Processor'),
    'description': tr('A fake pre processor.'),
    'condition': check_nearby_preprocessor,
    'process': {
        'type': function_process,
        'function': fake_nearby_preprocessor,
    },
    'output': {
        'type': 'layer',

        'key': layer_purpose,