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

Hi everyone I'm trying to get all nodes with tag "entrance"="main" which are part of a relation with ways that have the tag "building"="train_station" through the Overpass Turbo API. I searched https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL for it but couldn't find a matching example.

Any help with this issue would be appreciated a lot :-)

Greetings, Egaru

asked 24 Apr '18, 15:28

Egaru's gravatar image

Egaru
16224
accept rate: 0%

There wouldn't typically be a reason for there to be a relation like you describe, so even if you could create the right query, it probably wouldn't find any results.

(24 Apr '18, 17:31) alester

There's filters to directly make the steps that you specify;

Here's a working script (I've used entrance instead of entrance=main to make it quicker to test):

[bbox:{{bbox}}];
way[building=train_station];
rel(bw);
node(r)[entrance];
out;

I guess without a bounding box it will be slow or timeout.

permanent link

answered 24 Apr '18, 20:36

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Thanks for your responses! Perhaps my question was a bit vaguely phrased so I try again :-)

With the query node"entrance"=main; I get main entrances as nodes. However, it could be the entrance of a library, railway station, town hall or anything else. To reduce the nodes to such belonging to railway stations, I need to filter them. When I select the node on the map and click on the node ID, I see in the "Part of" section, that it belongs to a way having the tag building=station. Thus I think these objects are related and thus can be used in a query.

@maxerickson: Unfortunately this query doesn't return any objects. Is it intended to work in the way I tried to explain above?

(25 Apr '18, 07:25) Egaru

There might not be any matching data.

This query just looks for entrance nodes that are part of building=train_station ways: http://overpass-turbo.eu/s/yfy

(25 Apr '18, 12:25) maxerickson

I've found the problem: The region I chose for testing had the tag building=station instead of building=train_station. Taking the union of both tags yielded the desired result:

[bbox:45.10378,5.53772,47.54818,9.49703]; (way[building=station]; way[building=train_station];); node(w)[entrance]; out;

Thanks a lot for your help!

(26 Apr '18, 08:22) Egaru
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:

×483
×236
×228

question asked: 24 Apr '18, 15:28

question was seen: 3,061 times

last updated: 26 Apr '18, 08:22

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