How do you clean up bad OSM data to make the ways properly connected and thus routable?

How do graphhopper avoid the problems with bad OSM data quality?

For example, regarding OSM ways that seem to be terminal nodes (according to OSM data but when they in reality are connected).
(see “Common noding errors plaguing OSM networks”: https://www.gaia-gis.it/fossil/spatialite-tools/wiki?name=graphs-intro )
Another problem with OSM data is crossings without nodes that define junctions.
If you are using some algorithm that detect crossings of lines and then replace those with new lines (with a new common node at the intersection point), then you might introduce new problems when the detected “crossing” is not actually a real crossing but instead a bridge or a tunnel.

So, how do you deal with these kind of problems?
I guess you are improving the OSM data somewhere in your codebase but where?
Is your data cleaning code tightly coupled with Graphhopper, or is there some class that can be used separately?
I mean some method like this:
OsmDataCleaningClass.createNewPbfFileWithRouteableData(“inputfile_OSM_PBF.pbf”, “outputfile_with_cleaned_routable_ways.pbf”);

/ Tom

Powered by Discourse