- 00 - The Beginning
- 01 - Finding nodes with a bounding box
- 02 - Outputting data about nodes
- 03 - Filtering nodes that have a tag
- 04 - Find nodes by matching tags and their values
- 05 - Find nodes by applying multiple filters
- 06 - Extracting multiple sets of nodes
- 07 - Calculating differences between results
- 08 - Generating JSON output
- 09 - Generating CSV output
- 10 - The default set
- 11 - Querying a set
- 12 - Searching within a radius using around
- 13 - Using around to filter against a set of results
- 14 - Searching by polygon
- 15 - Finding ways
- 16 - Ways and their nodes
- 17 - Ways and their tags
- 18 - Combining node and way queries
- 19 - Finding ways from their nodes
- 20 - Finding relations
- 21 - Type agnostic queries (nwr)
- 22 - Areas
- 23 - Finding the areas enclosing a feature
- 24 - Find the area derived from a feature
- 25 - Areas via Nominatim search
- 26 - Timeouts and endpoints
13 - Using around to filter against a set of results
around filter can be used to find features that are near to a previously
extracted set of results.
This, more powerful, use of the filter is illustrated in this query.
The query does two things.
Firstly it searches within the bounding box to find all nodes that are
tagged as peaks. These nodes will be automatically stored in the default set ("
The second part of the query then filters to just those nodes that are tagged as caves AND are within 850m of one of the previously found results.
In this case there is only a single peak within our bounding box (the summit of Uluṟu), so the query returns just those caves that are within 850m.
around filter isn't provided with coordinates, or a set of coordinates,
then it uses the default set ("
_") as the basis for its search.
As with other query statements, you can also specify the set to use. The comments in the query indicate an alternative way to achieve the same result but using named sets.
My suggestion is to always used named sets to make your queries more readable.
This way of using
around is much more powerful than specifying a fixed radius
or line. We can instead do more complex queries such as finding amenities that
are near to bus stops or a road.
When experimenting with this query try using the
out count variation. This
produces a count of the nodes, rather than their coordinates and tags. Useful
if you just want to do some quick analysis or collect some figures.
Tip: If you try
out count, Overpass Turbo may warn you that there are
no results it can display on the map. Just look at the data tab instead.