Hello,

I would like to get all motorway junctions with their roadnames. At the moment, I'm using this:

[timeout:3600][maxsize:1073741824][bbox:{{bbox}}];
way[highway~"^(motorway)$"];
node(w)[highway=motorway_junction];
(._;>;);
out meta;

Which works, but it gives me the following output:

{
  "type": "Feature",
  "properties": {
    "@id": "node/9200769",
    "highway": "motorway_junction",
    "name": "Kreuz Rostock",
    "ref": "9",
    "@timestamp": "2015-04-09T06:46:01Z",
    "@version": "10",
    "@changeset": "30082198",
    "@user": "da-sch",
    "@uid": "200139"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [
      12.1994746,
      54.0327681
    ]
  },
  "id": "node/9200769"

I can't find any information, which says, on which road this junciton is. I do not mean the destination road. In my example it would be the road(highway) "A20". For testing i'm using overpass turbo.

Could somebody please help me?

asked 28 Aug '17, 12:22

_supersonic's gravatar image

_supersonic
11112
accept rate: 0%

Are you asking about the data model, or about the overpass syntax?

As to data model, "A 20" is the value of the destination:ref=* tag on the highway=motorway_link road that node 9200769 is part of. I don't know the overpass syntax for requesting that information.

(28 Aug '17, 12:55) dsh4

The node(w) here means you are only fetching motorway_junction nodes that are part of a highway=motorway (or motorway_link; this is subtlety different than all motorway_junction nodes).

way[highway~"^(motorway)$"];
node(w)[highway=motorway_junction];

I think there is no way to get Overpass to amend the nodes with information from the parent ways, but you can at least return the ways as part of your Overpass query and then use the node ids to find information about parent ways:

[timeout:3600][maxsize:1073741824][bbox:{{bbox}}];
(
way[highway~"^(motorway)$"];
node(w)[highway=motorway_junction];
);
out meta;

Overpass Turbo might warn that this query is broken because it doesn't return the full geometries of the ways, but if I understand correctly you don't care about the way geometry, so just ignore the warning.

permanent link

answered 28 Aug '17, 13:57

maxerickson's gravatar image

maxerickson
9.6k868135
accept rate: 31%

Your answer
toggle preview

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:

×318
×224
×174
×173
×118

question asked: 28 Aug '17, 12:22

question was seen: 720 times

last updated: 28 Aug '17, 13:57

powered by OSQA