Contribute to project
Intro

Around Filter Improve page

“Woah, it’s empty! Could it be that there are no restaurants near me?” asks Bob.

Not really. See, our first statement node(2190458950) is already a node, so filtering it further wouldn’t do anything! And since we added a new filter (restaurants) to a statement that we know gives us a tree, we basically asked OSM to further filter our result set (a tree node) to only show restaurants, which obviously results in OSM nothing (since a tree is not a restaurant)!

Our previous examples worked because we filtered for nodes with tags present in an area (the bounding box with lat/lon points). We essentially queried for nodes in an area, then used filters to filter it down to a tree.

Right now, since our node is already a node, we can’t just use a filter to get a restaurant from it. We have to get a new area from the node.

To do this, we can make great use of another filter, named around.

Instructions
  1. Around is a filter which queries for anything around our existing result set (in this case our tree node). Since our result set is given by our first line, we need to make another statement. To do this, create a new line after the first line, so you have a blank 2nd line.
  2. Unlike by tag filters, around filters are surrounded by parenthesis, and follows the format (around:n) where n is your distance radius in meters. Let’s try setting the distance radius to 50.
  3. On your 2nd line, go ahead and write node followed by your around filter. Make sure to follow the format in 2!
  4. Don’t forget to add a semicolon to end your statement!
That doesn't seem right! Remember to make a new query statement! Don’t just add around to the first line.
node(48.5657094, 13.4490548, 48.5662416, 13.4501676)[natural=tree][height=20]; node(around:50); out;