I'm trying to write an Overpass query to get all ways (filtered with a specific tag) which aren't included in a relation (with a specific tag). Here is my query (edited after maxerickson's answer): https://overpass-turbo.eu/s/HXj // Collect all ways with piste:type=nordic and store the result in a variable .all way({{bbox}})["piste:type"="nordic"]->.all; // Select all relations, where one of the ways in variable .all is a member rel["piste:type"="nordic"](bw.all); // ...and for those relations find all related way members way(r); // Calculate the set difference (._ contains all nodes which are member of a relation) ( .all; - ._; ); // return the result including meta data out meta; I followed this example, it's pretty close of what I want to do but for nodes, so I just changed a few things to get ways instead of nodes. Unfortunately my query doesn't return anything. Do you see anything wrong in my query? Edit after some debugging: here a way that the query should return (has a piste:typenordic tag and isn't part of a piste:type=nordic relation): https://www.openstreetmap.org/way/475719899
Thanks! asked 12 Apr '19, 14:17 billux |
You need something like
to even have anything in The answered 13 Apr '19, 03:28 maxerickson You're right, actually I wanted to use {{bbox}} first, but replaced it with area when I posted my question. I have updated my question with a link to the Overpass query and more information after trying to debug the query.
(13 Apr '19, 13:53)
billux
2
I'm not sure why, but naming the second result set helps: https://overpass-turbo.eu/s/HXB
(13 Apr '19, 17:34)
maxerickson
That's strange, I don't understand why ._ can't be used in that case. Anyway the query works as expected now. Thanks!
(14 Apr '19, 22:23)
billux
The
(26 Apr '19, 18:52)
Roland Olbricht
|