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

I'm using Overpass query to identify the nodes with a specific tag that are located only within a certain distance range from node with another specific tag. This sounds similar to this question related to proxmity search and this other distance calculation between nodes question.

But to tell the difference, I can try to explain with an example.

Find a cafe within a distance range of 450 m and 550 m from a library or

Find a gas station with a distance range of 9 km and 11 km from IKEA or

Find the railway crossing that is between a distance 900 m and 1100 m from a train station.

Query for 2nd search:

[timeout:300]; way[name=IKEA]({{bbox}}) -> .i; ((node[amenity=fuel](around.i:1100); way[amenity=fuel](around.i:1100););); out geom;

[timeout:300]; way[name=IKEA]({{bbox}}) -> .i; ((node[amenity=fuel](around.i:1100); way[amenity=fuel](around.i:1100););-((node[amenity=fuel](around.i:900); way[amenity=fuel](around.i:900);););); out geom;

I have used .around to specify the range limits and used out geom 1 to limit my result with only 1 output. For these 3 queries, the distance provided to .around clause will be considered as a direct distance and not the routing distance for a car or a train. How can I make sure that the train travels 0.9 to 1.1 km from station to the rail-crossing.

I wish to know if it is at all possible to achieve such query in Overpass. It would be great if there is confirmation for the same or suggestion to make this work through other method.


asked 26 Oct '18, 09:13

user1894's gravatar image

accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 26 Oct '18, 09:13

question was seen: 1,996 times

last updated: 26 Oct '18, 09:13

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