def get_upstream_basin(catchment, totalBasinGeom):
    """Get upstream basin geometry by subtracting the local catchment from the totalBasinGeom"""

    d = 0.00045
    cf = 1.3  # cofactor

    upstreamBasinGeom = totalBasinGeom.symmetric_difference(catchment).buffer(-d).buffer(d*cf).simplify(d)
    return upstreamBasinGeom