Search code examples
openstreetmapoverpass-api

Overpass: Search for POIs in a given perimeter


Using overpass-turbo.eu I want to query different types of elements near a certain point. Here's an example which returns all trees 150 meters around Big Ben in London.

[out:json][timeout:25];
( 
  node[name="Big Ben"]["addr:street"="Bridge Street"];
  node(around:150)[natural=tree];
);

out body;
>;
out skel qt;

It works for all trees. But what if I for example also want to find all shops 150 meters from Big Ben? Due to overpass' flow concept, I can use the Big Ben node only for the query next to the line where I've queried for Big Ben.

What I may need to do is to store Big Ben's node in a variable to access it for all queries following. How does this work?


Solution

  • Simply use the following Overpass syntax:

    (around:radius,latitude,longitude)
    

    In this case:

    node(around:150, 51.50069, -0.12458)[natural=tree];