v0.1.0 MIT Python ≥ 3.10 16 tests passing GIS Infrastructure

netsimplify

Topology-preserving simplification for geospatial infrastructure line networks.
Pins shared vertices (junctions, T-junctions, shared endpoints) so connectivity is never broken.

Quickstart

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

Why this exists

geopandas.simplify() processes features independently — shared endpoints drift apart, breaking network connectivity. No maintained Python library prevented this for line networks until now.

Source signals

Benchmark (20,200 features)

topology_preserving=True2.18s
topology_preserving=False1.09s
vertex reduction~68%

How it works

  1. Build planar graph of all features
  2. Find all shared vertices (degree ≥ 3 or shared endpoints)
  3. Pin those vertices in Douglas-Peucker
  4. Validate: assert same components & junction count