Contribute to project
Intro

Filter by Tag III Improve page

“Woah, great! I see a lot of nodes around me, but there are too many, and I’m not sure which are the restaurants!”

We used the around filter on our previous example to query for nodes around our particular node, and it worked! As you can see on the map viewer, we see the OSM data around our first statement.

However, it’s quite problematic - we haven’t actually found any restaurants, and there are too many nodes!

Again, we will use the concept that we learned earlier to further filter our data. around gave us a bunch of nodes, so we need to use filter by tag ([k=v]) to filter it to only restaurants.

Go ahead and combine our around filter with our by tag filter!

Instructions
  1. Our around filter gave us a bunch of nodes around our first node, but there are no restaurants in it, and there are too many nodes!
  2. Increase our around distance a bit more. Bob says he sees a restaurant about a 450 meters distance from him, so go ahead and use that as a distance filter for around.
  3. Use a filter by tag to query for restaurants. You can use the tag [amenity=restaurant] for this.
  4. Remember that we are filtering our data from our around set, so make sure to add the filter tag after our around filter.
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:450)[amenity=restaurant]; out;