# How to isolate the 2 lists of ways for each driving direction in a Motorway relation ?

 0 Hello, I'm interested in the way "Motorways" are described in OSM. For instance that one : http://www.openstreetmap.org/browse/relation/107088 describes a motorway between 2 cities : Paris and Lille (North of France). However the members of the relation are for both driving directions : Paris -> Lille AND Lille->Paris . Is there an "easy" way to know which ways are part of the Paris->Lille driving direction and which ones are only relevant for the other driving direction (=split the relation in two parts, one for each driving direction) ? Any hint or idea is welcome to extract such information from the relation ! Thanks. asked 19 Feb '11, 20:35 y0n3l 6●2●2●4 accept rate: 0%

 1 The best solution would be to split the relation into two parts, one for each driving direction. In the US, directional roles have been used: north/south/east/west, but this does not seem to be the convention in France. answered 21 Feb '11, 12:40 Mike N 2.8k●2●19●53 accept rate: 17% I would include the two new relations in a super relatin, too (28 Feb '11, 20:56) Baloo Uriza
 0 I'm not that an easy solution exists. Maybe you can code (for example with python and DOM) an analyser on the data that, starting from a node, build the set of ways that are connected. answered 22 Feb '11, 09:26 NicolasDumoulin 3.3k●4●22●56 accept rate: 13% Hello Nicolas, Yes this is what I ended up with : I split the relation in x parts on my side by finding which ways have common nodes. (27 Feb '11, 14:20) y0n3l Good. Maybe you can flag your question as answered :-) And it will be nice to post your script if it is possible. (28 Feb '11, 10:42) NicolasDumoulin Yes, I'll flag the question as answered, but I was waiting for a little while to see different answers (actually I think that Mike's answer is the right one, after a more in depth look , I saw that some french highways were using this tag, but only a few of them). For the scripts , humpf, it's written in ObjectiveC so unless you're in the Mac / iOS I think it's useless :/ Are you the guy from http://pld.dumoulin63.net ? I'm also on open street map fr ;) (28 Feb '11, 20:31) y0n3l Ok, ObjectiveC will be useless for me. Yes, it's the same dumoulin ;-) (01 Mar '11, 08:43) NicolasDumoulin
 0 You could try ignoring relations, and extracting "WayChains". A chain of ways that are connected end-to-end. My WayChains TIGER fixup analysis does this kind of thing (on motorways as it happens, although it would work for other kinds of end-to-end connected ways) The logic to join together ways into "waychains" can be found in waychainsummary.rb. I'm running it with a pre-processing step using my osmosis simplify plugin, which reduces ways down to just their start node and end node. Note however that I was deliberately designing this to help find problems in the U.S. motorways data. For extracting OpenStreetMap data for practical use, you may find this approach a little fragile. e.g. if a mapper tags an onramp with highway=motorway instead of highway=motorway_link, then it may not chain the ways correctly at that point. You'd have to fix it before trying again. answered 01 Mar '11, 11:32 Harry Wood 9.3k●25●87●127 accept rate: 14%
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×209
×154
×23

question asked: 19 Feb '11, 20:35

question was seen: 4,253 times

last updated: 01 Mar '11, 11:32