neatnet.remove_interstitial_nodes#
- neatnet.remove_interstitial_nodes(gdf, *, aggfunc='first', **kwargs)[source]#
Clean topology of existing LineString geometry by removal of nodes of degree 2.
Returns the original gdf if there’s no node of degree 2.
- Parameters:
- gdf
geopandas.GeoSeries
|geopandas.GeoDataFrame
Input edgelines process. If any edges are
MultiLineString
they will be exploded into constituentLineString
components.- aggfunc
str
|dict
= ‘first’ Aggregate function for processing non-spatial component.
- **kwargs
Keyword arguments for
aggfunc
.
- gdf
- Returns:
geopandas.GeoSeries
|geopandas.GeoDataFrame
The original input
gdf
if only 1 edgeline, otherwise the processed edgeline without interstitial nodes.
Notes
Any 3D geometries are (potentially) downcast in loops.