def general_spatial_relation(sp_el1, sp_el2, f):
    """General function for computing spatial relations with a function f
    given.

    Parameters
    ----------
    sp_el1: optional
        the spatial information of element 1.
    sp_el2: optional
        the spatial information of element 2.
    f: function
        function to compute spatial relation between spatial objects.

    Returns
    -------
    rel: float
        number of the the relation between the spatial object.

    """
    rel = f(sp_el1, sp_el2)
    return rel