momepy.close_gaps

momepy.close_gaps(gdf, tolerance)[source]

Close gaps in LineString geometry where it should be contiguous.

Snaps both lines to a centroid of a gap in between.

Parameters:
gdf : GeoDataFrame, GeoSeries

GeoDataFrame or GeoSeries containing LineString representation of a network.

tolerance : float

nodes within a tolerance will be snapped together

Return type:

GeoSeries