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

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.

This question is marked "community wiki".

asked 23 May '14, 16:09

gmeister4's gravatar image

gmeister4
608812
accept rate: 0%

edited 23 May '14, 18:39

tyr_asd's gravatar image

tyr_asd
1.2k51927

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
×147
×91
×55

question asked: 23 May '14, 16:09

question was seen: 4,130 times

last updated: 23 May '14, 18:39

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