find_nearest_branch

find_nearest_branch(branches, geometries, method='overall', maxdist=5)

Determine nearest branch for each geometry.

The nearest branch can be found by finding t from both ends (ends) or the nearest branch from the geometry as a whole (overall), the centroid (centroid), or intersecting (intersect).

Parameters

Name Type Description Default
branches geopandas.GeoDataFrame Geodataframe with branches required
geometries geopandas.GeoDataFrame Geodataframe with geometries to snap required
method Method for determine branch 'overall'
maxdist Maximum distance for finding nearest geometry 5
minoffset int or float Minimum offset from the end of the corresponding branch in case of method=equal required