def earthquake_contour_preprocessor(impact_function):
    """Preprocessor to create contour from an earthquake

    :param impact_function: Impact function to run.
    :type impact_function: ImpactFunction

    :return: The contour layer.
    :rtype: QgsMapLayer
    """
    contour_path = create_smooth_contour(impact_function.hazard)

    if os.path.exists(contour_path):
        from safe.gis.tools import load_layer
        return load_layer(contour_path, tr('Contour'), 'ogr')[0]
Preprocessor to create contour from an earthquake

    :param impact_function: Impact function to run.
    :type impact_function: ImpactFunction

    :return: The contour layer.
    :rtype: QgsMapLayer