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 |
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):
I guess without a bounding box it will be slow or timeout. answered 24 Apr '18, 20:36 maxerickson 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
|
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.