It’s also possible to query for things around a named reference place. For example, in your next task, you will ask for hotels in walking distance of the Taj Mahal. There are four named maximum distances, which are explained in the table below.

Maximum distance name Kilometers Comment
WALKING_DIST 1 Used for phrases such as “in walking distance of”
DIST_INTOWN 5 Default distance used for phrases such as “near”, “close to”.
DIST_OUTTOWN 20 Used for phrases such as “in the surroundings of”
DIST_DAYTRIP 80 Used for phrases such as “within a daytrip of”

Show me all alpine huts in the area of Mont Blanc

Question ClassThing around Reference Point
Target Tagstourism=alpine_hut
Reference Pointname=Mont Blanc
Maximum DistanceDIST_OUTTOWN
QTypelatlong

Instead of using a named distance, you can also specify an exact maximum distance like in the following example. Note that even though the question uses the wording “2 kilometers”, the maxdist value used is in meters: “2000”.

Count the cafes within 2 kilometers of the Monument to the Battle of the Nations in Leipzig!

Question ClassThing around Reference Point
Target Tagsamenity=cafe
Reference Pointname=Monument to the Battle of Nations
AreaLeipzig
Maximum Distance2000
QTypecount

  1. Ask for hotels in walking distance of the Taj Mahal with the query below.
  2. Correct errors in the MRL and send your feedback.

Are there any hotels that we can walk to from the Taj Mahal?

{% if completed %}

✔ Completed.

query(around(center(nwr(keyval('name','Taj Mahal'))),search(nwr(keyval('tourism','hotel'))),maxdist(WALKING_DIST)),qtype(least(topx(1))))

{% else %}

❌ Not completed yet.

{% endif %}