1
1

I would like to find all objects with an amenity tag within the radius of a location given by coordinates. E.g. I have a location and want to find what restaurants, bars, cafes, cinemas, etc. are around. For each found object I need its name and its address.

As far as I have found out I can query Nominatim for special phrases and specific amenities but I'm not sure how to query for all amenities.

Is this possible with Nominatim and how is it done? Or should I rather use Overpass or something different for such a scenario?

Thanks for your help!

asked 10 Dec '16, 10:36

acgjheeb's gravatar image

acgjheeb
101338
accept rate: 0%


2 Answers:
2

As @SK53 suggested use 'around' filter with overpass api for all amenities. Here is the example:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“aminity=*”
*/
[out:json];
// gather results
(
  // query part for: “aminity=*”
  node["amenity"](around:2000,51.5,0.01);
  way["amenity"](around:2000,51.5,0.01);
  relation["amenity"](around:2000,51.5,0.01);
);
// print results

out;
>;
out skel qt;

With get method same request to overpass API:

http://overpass-api.de/api/interpreter?data=[out:json];(node[%22amenity%22](around:2000,51.5,0.01);way[%22amenity%22](around:2000,51.5,0.01);relation[%22amenity%22](around:2000,51.5,0.01););out;%3E;
permanent link

answered 13 Dec '16, 04:45

Gagan's gravatar image

Gagan
2902413
accept rate: 14%

5

Definitely use Overpass which has an around operator.

This is an example of such a query: http://overpass-turbo.eu/s/kzx.

Note that not every POI will have address information in OSM: it really depends on how much detail local mappers have entered into OSM.

permanent link

answered 10 Dec '16, 14:20

SK53's gravatar image

SK53 ♦
23.6k46238372
accept rate: 20%

1

sometimes the address information is there, but on the building, not on the POI itself. Overpass cannot solve this I think

(10 Dec '16, 15:10) escada
1

Regarding addresses: Maybe an is_in query can help but not sure if it includes unnamed areas with address tags.

(10 Dec '16, 15:40) scai ♦

No, looks like is_in finds only named areas. It doesn't returns buildings with addresses but without a name. But a reverse-geocoding call to Nominatim would help do determine the address.

(10 Dec '16, 22:20) scai ♦

Thanks a lot! I will dive into Overpass and try it out. If the address is not always there, is there at least a reliable way to determine the POIs city?

(11 Dec '16, 19:49) acgjheeb

I guess separate reverse geocoding of the results with Nominatim won't be an option as it would produce a lot of traffic for Nominatim...

(11 Dec '16, 19:51) acgjheeb

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×591
×377
×126
×88
×19

question asked: 10 Dec '16, 10:36

question was seen: 4,927 times

last updated: 13 Dec '16, 04:45

powered by OSQA