My goal is to calculate lots of distances along the streets. I followed http://workshop.pgrouting.org/ tutorial except that I used osm2po instead of osm2pgrouting to import osm file. The only problem I'm facing now are gaps in results - Dijkstra algorithm seems to fail in finding the route between two nodes of the network in 10% of cases. It simply returns nothing, empty table. I suppose the problem is with the map, that it's not "routable enough" (I can't imagine any other reason). Did anyone have the same situation? Do you know how to fix it? enter image description here


1 Answer 1


With osm2po (and some basic Java skills) this is possible. Call DefaultRouter with a random vertex sourceId and set the targetId to 0. This lets the Dijkstra expand the complete graph. Finally call getVisited() to collect all visited vertices. Vertices which are not visited belong to isolated edges. If you've randomly hit an isolated vertex you'll receive a rather small set of visited nodes. If so, start over with next random.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.