For an academic project involving road maintenance, I need to create a routing graph from geographical data. I was wondering whether someone could tell me whether creating the following graph is possible using OSM data. A 'traditional' routing graph would be something like: a vertex is an intersection, an edge between 2 vertices connects 2 intersections. In my application I need something more fine-grained. I need to create the following multigraph:
Example. Given the following intersection at the top of the picture. Let's assume that u-turns are not permitted. The arrows indicate driving directions for each lane. At the bottom you see the resulting routing graph which implements all traffic rules. U-turns are easily incorporated by 'merging' two nodes. For each lane I need to know it's length and the allowed driving speed. I'm only interested in roads for cars (no walkways/bicycle lanes). It would be great if someone could tell me whether it is possible to extract this kind of data from OSM. Any examples, references to existing code or references to relevant documentation are highly appreciated. If this is not possible in OSM, do you know other data sources which I could use instead (e.g. Google maps, HERE maps, etc)? asked 09 Jun '15, 21:06 JorisK |
In those locations where OSM has lane data (which is far from everywhere), generating a graph according to your specifications is possible. Relevant documentation can be found here: I don't know any library that does this for you, however. So if the suggestions by @iii don't do what you want, you would have to do it yourself. answered 17 Jun '15, 18:01 Tordanik |
A lane based directed routing graph is possible, even if I don't know which toolset can help you. You might check out TrafficMining framework or start using pgrouting and tune osm2pgrouting. Also eWorld might be an idea? answered 09 Jun '15, 21:59 iii |
You could use GraphHopper as a starting point for this. Then you already have a good routing graph for cars. For detailed lane support you'll need to tweak it a bit, but as GraphHopper supports any directed graph in its lower level Java API you can model nearly anything with it. Disclaimer: I'm the author answered 19 Jun '15, 22:15 peatar |