Getting the Id of a Way from coordinates and inserting into another query
Hello,
I am making an application that uses the Overpass API.
I want a query that returns the roads for any given way that connect to that road.
Is there a way to retrieve a single way id for a given coordinate/ boundary box, then storing this in a variable and running it in another query?
Here is an example query:
way(4419793);
(way(around:0)[highway~"."][highway!~"path|track|cycleway|footway|service|residential|bridleway"];(._;>;))->.a;
(way(around:0)[highway~"."][highway!~"unclassified|path|track|cycleway|footway|residential|service|bridleway"];(._;>;))->.b;
(way(around:0)[highway~"."][highway!~"unclassified|path|track|cycleway|footway|residential|service|bridleway"];(._;>;))->.c;
(way(around:0)[highway~"."][highway!~"unclassified|path|track|cycleway|footway|residential|service|bridleway"];(._;>;))->.d;
(.a;.b;.c;.d;);out;
What I want to do is find a way to get the way id automatically from a bounding box/ pair of coordinates and run the new query in the form:
.var = (node(51.249,7.148,51.251,7.152);<;);out;
way(.var);
(and the .var contains the first returned way id for example)
....
Cheers.