NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm looking for algorithm which could help me with building my own road network (for routing) from OSM data.

I chose Spatialite DB for this, but here I have only one problem: Spatialite provides interface for build road network, but prepared road graph is saved in BLOBS so I can't get any information about it (of course, I can write queries to DB for routing facilities) but I want to draw all links on my map, so I need to get their coordinates.

Actually, I'm not sure if Spatialite could provide such API or smith like that.

I don't understand how to define junctions(links) between roads through all this data. My first idea was that all ways could be used as the arcs of graph. But I'm not sure if they doesn't consist links inside them. I mean that in <way> first and last nodes always links and only they, whereas other nodes mentioned in this <way> is used only for geometry of they way

Is that statement right ?

asked 20 Nov '13, 10:25

TemaKrukovets's gravatar image

TemaKrukovets
1111
accept rate: 0%

2

This is not quite correct. The first and the last node don't have to be links, a way can have one or even two open ends. Furthermore every node in the way can be part of one or more other ways, thus creating a junction. This is not limited to the first and last node.

(20 Nov '13, 10:33) scai ♦

@scai , So, how can i define links to build graph? Manually look for nodes which mentioned in 2 or more ways ?

(20 Nov '13, 10:44) TemaKrukovets
4

Yes. But you wouldn't do that manually. Enter the term "graph" in the search box above and read some of the results.

(20 Nov '13, 10:51) Frederik Ramm ♦

The preprocessing of OSM data for routing can be very tricky, as you have to take a lot of stuff into account (access and surface tags, restrictions, defaults per country, ...).

If you just like to create/try an routing algorithm, you might try this framework, that creates already a graph for you: http://code.google.com/p/trafficmining/. You might also consider other existing solutions as osm2pgrouting if you aren't tied to Spatiallite DB http://wiki.openstreetmap.org/wiki/Routing

permanent link

answered 21 Nov '13, 09:40

iii's gravatar image

iii
4.9k84082
accept rate: 10%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×305
×167
×163
×29
×18

question asked: 20 Nov '13, 10:25

question was seen: 5,803 times

last updated: 21 Nov '13, 09:40

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum