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:
gdfGeoDataFrame, GeoSeries

GeoDataFrame or GeoSeries containing LineString representation of a network.

tolerancefloat

nodes within a tolerance will be snapped together

Returns:
GeoSeries