To apply algorithms like Dijkstra on a graph, we need nodes and the distance between each node as weights. In real world these weighted graphs are actual maps and the weights are distance of road. We are looking for a library or a tool which we can be used to convert these map files(.shp or .osm) into a weighted graph or an adjacency matix? asked 13 Jan '21, 06:27 Kartikeya |
There are a number of tools which will populate the pgrouting schema in PostGIS from OSM data too: osm2pgrouting and osm2po (latter is closed source proprietary software). You can readily interrogate the pgrouting tables with SQL queries and use different algorithms & weights for routing, so although not the most efficient routing method it's quite a good set-up for experimentation. Anita Graser has written a number of tutorials about pgrouting itself. answered 13 Jan '21, 13:13 SK53 ♦ Thanks for the help. We just wanted to find the shortest path by a* or dijkstra, but not by any API. We have an osm file and want to extract nodes, edges and the distance between nodes from the same file(python preferably).
(03 Feb '21, 16:02)
Kartikeya
|
https://github.com/Tristramg/osm4routing2 is the easiest I've found to create a routing graph from OSM data. answered 13 Jan '21, 12:39 Richard ♦ |