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
MultiLineStringthey will be exploded into constituentLineStringcomponents.- aggfunc
str|dict= ‘first’ Aggregate function for processing non-spatial component.
- **kwargs
Keyword arguments for
aggfunc.
- gdf
- Returns:
geopandas.GeoSeries|geopandas.GeoDataFrameThe original input
gdfif only 1 edgeline, otherwise the processed edgeline without interstitial nodes.
Notes
Any 3D geometries are (potentially) downcast in loops.