Cleaning a line network
GAMA's clean_network operator processes line geometries before they are used to build or analyze a road graph. It accepts a list of line geometries (or agents), a tolerance, a setting for splitting lines at intersections, and a setting for keeping only the main connected component. It returns a list of cleaned line geometries.
The tolerance is measured in the coordinate units of the input geometries. Choose it for the scale and precision of the data: a larger tolerance can connect endpoints that are farther apart. There is no universal tolerance value.
Use the split_lines option when intersections should become line endpoints, and the final option when disconnected components should be removed. Set each option according to whether those changes are appropriate for the source data and analysis.
See the complete clean_network operator reference for its behavior and examples. The GAMA model library includes a runnable Clean Road Network model that loads road data, applies the operator and builds a graph from the resulting lines.