def snaps_to_hydroobject(gdf, datamodel, method, tolerance=0.001, dtype=bool):
    """
    Check if geometries snap to HydroObject

    Parameters
    ----------
    gdf : ExtendedGeoDataframe
        ExtendedGeoDataFrame, typically a layer in a HyDAMO datamodel class
    datamodel : HyDAMO
        HyDAMO datamodel class
    method : str, options: 'intersecting', 'overal', 'centroid', 'ends'
        Method that can be used to deterine nearest hydrobject
    tolerance : numeric
        Tolerance used to snap to the hydroobjct
    dtype : dtype, optional
        Dtype to assign to the result series. The default is bool.

    Returns
    -------
    Pandas Series
        Default dtype is bool

    """

    branches = datamodel.hydroobject
    gdf.snap_to_branch(branches, snap_method=method, maxdist=tolerance)
    series = ~gdf.branch_offset.isna()
    return series.astype(dtype)