flatten_network function

Flatten a network by adding points at apparent intersections.