Closest Object Only

In the previous example, we found all hotels within a certain distance of Taj Mahal, but what if we only want to know about the closest one? It’s possible to specify that by limiting the results to the closest object with the “Limit to” field.

Multiple Tags

Not every query can be answered by just looking for one specific tag. With some queries, we are looking for objects that have two specific tags at the same time. A typical example is a restaurant serving a specific cuisine, like in the following example. (Note that the two tags are just separated by a comma when both should apply.)

Chinese restaurants in Rome

Question ClassThing in Area
Target Tagsamenity=restaurant,cuisine=chinese
AreaRome
QTypelatlong

With other queries, we are looking for objects that have either of two possible tags. This can be due to our query not caring about subtle differences or due to idiosyncrasies in the OpenStreetMap data. When you’re looking for an ATM to draw cash, you probably want to include dedicated ATMs as well as banks that happen to have an ATM. (Here, the tags are connected by an “or” operator.)

Closest ATM to Spanish Steps in Rome

Question ClassThing around Reference Point
Target Tagsor(amenity=atm,atm=yes)
Reference Pointname=Spanish Steps
AreaRome
Limit toClosest
QTypelatlong

In these multi-tag cases, it can be hard to know what tag combination you’re really looking for. That’s why there is dedicated help for the most common ones available. You can recognize it by its golden border. Please respect the tag combination that is given in these tips if you’re not 100% sure what you’re doing.

Custom suggestions for ‘food’
  1. Ask the question below.
  2. Correct errors and send feedback. You will have to adjust several things in this case!

Name the synagogue that is closest to the Országház in Budapest!

{% if completed %}

✔ Completed.

query(around(center(area(keyval('name','Budapest')),nwr(keyval('name','Országház'))),search(nwr(keyval('amenity','place_of_worship'),keyval('religion','jewish'))),maxdist(DIST_INTOWN),topx(1)),qtype(findkey('name')))

{% else %}

❌ Not completed yet.

{% endif %}