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

For my bachelor project I'm working on a bicycle route planner and I'm trying to get, at the very least, the nodes and connections, with matching distance data for the bicycle route network in (a part of) the Netherlands.

When I zoom in on The Netherlands the bicycle nodes and the conenctions between them are numbered and listed in light blue, so I know the data is there, and I assume there is also distance data available. I have downloaded the .osm for the benelux, but now I have no idea how I can retrieve the data. I've been looking around but I haven't really found a tutorial or something. Can someone point me in the right direction?

asked 13 Dec '12, 11:37

Zoefschildpad's gravatar image

Zoefschildpad
21224
accept rate: 0%


I guess you're not familiar with the OSM file format, so please read a bit about tagging first.

I'll try to explain it on programmers level without a background in OSM, if this is wrong, please tell me what level you expect.

Basically, OSM data has 3 primitives: Nodes, Ways and Relations. Nodes just have single geographical coordinates, Ways are an ordered list of nodes, and Relations are a collection of other features (thus Nodes, Ways and other Relations).

Every primitive can have a number of tags to denote what type of feature it is.

For the case you're looking at, nodes have a tag rcn_ref=xx (regional cycling network reference), and the ways between those nodes are part of a relation. The relation is tagged as following:

type=route
route=bicycle
network=rcn
note=xx-yy

You can't trust on the correctness of the "note" tags, so you have to calculate the end nodes by getting all the ways in the relation, combining it to a single line and checking the end nodes of that line.

PS: Note that you don't have to download all data, there are services available where you can just download parts of the data (with the tags you want), see Overpass or XAPI

PS2: the tags with rcn are also used in other countries, where they are normal (long) cycle routes, so no node-networks. So you do have to implement extra checks and provide bounding boxes to be sure you're working with node networks.

PS3: User Polyglot also made relations per cycle node network in Belgium, see this: relation 1726882, if you want information regarding cycle nodes you can also contact him.

permanent link

answered 13 Dec '12, 13:26

Sanderd17's gravatar image

Sanderd17
1.1k51637
accept rate: 31%

That was really helpful, I think I got the nodes and ways now. One thing I noticed though is that there isn't a length-attribute in the ways, is there an easy way to calculate the length of a way?

(15 Dec '12, 17:20) Zoefschildpad
1

There are a bunch of links that might be useful here and another explanation here.

(15 Dec '12, 18:07) SomeoneElse ♦
1

OSM only has the raw data (including distances would be redundant as they can be calcualted), so you have to do the calculation yourself. The links given by SomeoneElse are indeed useful.

(16 Dec '12, 12:55) Sanderd17

In this thread on the Dutch language part of the OpenStreetMap forum. People talk about how they constructed this map. Including examples of the Overpass queries they used to get the bicycle network. You can find all the queries in the javascript files of the website.

permanent link

answered 13 Dec '12, 15:38

cartinus's gravatar image

cartinus
7.0k1066105
accept rate: 27%

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:

×205
×85
×11

question asked: 13 Dec '12, 11:37

question was seen: 8,181 times

last updated: 16 Dec '12, 12:55

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