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 Class | Thing around Reference Point |
Target Tags | tourism=alpine_hut |
Reference Point | name=Mont Blanc |
Maximum Distance | DIST_OUTTOWN |
QType | latlong |
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 Class | Thing around Reference Point |
Target Tags | amenity=cafe |
Reference Point | name=Monument to the Battle of Nations |
Area | Leipzig |
Maximum Distance | 2000 |
QType | count |
Are there any hotels that we can walk to from the Taj Mahal?
✔ Completed.
query(around(center(nwr(keyval('name','Taj Mahal'))),search(nwr(keyval('tourism','hotel'))),maxdist(WALKING_DIST)),qtype(least(topx(1))))
❌ Not completed yet.
{% endif %}