neatnet.fix_topology

Contents

neatnet.fix_topology#

neatnet.fix_topology(roads, eps=0.0001, **kwargs)[source]#

Fix road network topology. This ensures correct topology of the network by:

  1. Adding potentially missing nodes…

    on intersections of individual LineString endpoints with the remaining network. The idea behind is that if a line ends on an intersection with another, there should be a node on both of them.

  2. Removing nodes of degree 2…

    that have no meaning in the network used within our framework.

  3. Removing duplicated geometries (irrespective of orientation).

Parameters:
roadsgeopandas.GeoDataFrame

Input LineString geometries.

epsfloat = 1e-4

Tolerance epsilon for point snapping passed into nodes.split().

**kwargsdict

Key word arguments passed into remove_false_nodes().

Returns:
gpd.GeoDataFrame

The input roads that now have fixed topology and are ready to proceed through the simplification algorithm.