This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Overpass Turbo: How to find all intersecting roads over AND under a motorway without making 2 separate queries

1

Greetings -

I'm trying to write an Overpass-QL query to find all roads crossing a motorway/freeway - both on bridges above and bridged below. The above-the-road part is easy, but below is proving difficult. Is there syntax to use 'around(0)' to find something that FOO way is crossing above, but filtering out FOO itself? I tried using a ["ref"!~"FOO"] argument to filter it out, but that's not working.
I've been looking at this for too long, and my brain is mush. Help? Someone...?

Here's what I have:

[out:json][timeout:30][bbox:{{bbox}}];

way["ref"~"FOO"]->.road;
way(around.road:0)[bridge]["highway"~"^((primary|secondary|tertiary|trunk|motorway)(_link)?|service|residential|unclassified)"]->.xbridges;
way.road[bridge]->.br;
way(around.br:0)["highway"~"^((primary|secondary|tertiary|trunk|motorway)(_link)?|service|residential|unclassified)"]["ref"!~"FOO"]->.xways;
(.xways;
 .xbridges;);
out geom;

Thanks so much....

asked 01 Mar '22, 19:19

GregRetro's gravatar image

GregRetro
3547917
accept rate: 50%

Could you supply a link to a functioning example of your routine covering an area which contains examples of the objects you want returned. Provide a specific link to an object that doesn't get returned.

(09 Mar '22, 19:56) DaveF