Topology-preserving simplification for geospatial infrastructure line networks.
Pins shared vertices (junctions, T-junctions, shared endpoints) so connectivity is never broken.
pip install netsimplify
from netsimplify import simplify_network
import geopandas as gpd
gdf = gpd.read_file("water_mains.gpkg")
out = simplify_network(gdf, tolerance=0.5)
# Junctions guaranteed intact
geopandas.simplify() processes features independently — shared endpoints drift
apart, breaking network connectivity. No maintained Python library prevented this for
line networks until now.
| topology_preserving=True | 2.18s |
| topology_preserving=False | 1.09s |
| vertex reduction | ~68% |