I am looking for (the name of) a geometric algorithm for cartographic generalization of a street map.
In my map data, I have many paths (ordered list of points, connected by line segments) that lay close and almost parallel to one another. How do I (1) identify these “adjacent pathsˮ (i.e. how to find paths that are closer than a certain threshold) and (2) merge them into one path (i.e. how to compute the centerline between close paths)?
As an example, consider the following graph of roads / lanes of roads created with data from OpenStreetMaps:
As you can see, the two lanes of the road running horizontally are modeled as two separate paths. For detail views this is useful, but for a more zoomed out view I need to merge the two paths (lanes) to display only one line for the road.
What are the established algorithms used in map renderers to achieve this? Obviously, Google Maps, OSM, etc. do this -- how?