NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Here I asked for a near by search for restaurants around a node or town: https://help.openstreetmap.org/questions/80912/search-for-restaurants-around-a-distance

Now it would be helpful to perform the same search for an concrete address.

E. g. let's say all restaurants around a disctance of 1000 Meters "Platz der Republik 1, Berlin" (maybe also with zip code)

Would it be possible to build an address-replaceable query for that task?

I'm new to openstreetmap and it's hard for me to understand the overpass API

This wizard input text from the wiki gave me the hint: amenity=restaurant around "1600 Pennsylvania Ave NW, Washington"

So I got now this, successfully tested with two different addresses that I know:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=restaurant around "Bindlacher Straße 10 95448 Bayreuth"”
*/
[out:json][timeout:25];
// adjust the search radius (in meters) here
{{radius=100}}
// gather results
(
  // query part for: “amenity=restaurant”
  node["amenity"="restaurant"](around:{{radius}},{{geocodeCoords:Platz der Republik 1 10557 Berlin}});
  way["amenity"="restaurant"](around:{{radius}},{{geocodeCoords:Platz der Republik 1 10557 Berlin}});
  relation["amenity"="restaurant"](around:{{radius}},{{geocodeCoords:Platz der Republik 1 10557 Berlin}});
);
// print results
out body;
>;
out skel qt;

But may you review that, please and tell me if it's correct for what I need? It seems to, but I'm not 100 % sure about that.

asked 11 Jul '21, 22:29

alpham8's gravatar image

alpham8
26225
accept rate: 0%

edited 12 Jul '21, 23:58


If you want this information & know where you are but not the name of any localities, I've found this to be useful. {{center}} returns the co-ordinates of the centre of the OPT screen.

nwr[amenity=restaurant](around:1000,{{center}});
out center;
permanent link

answered 07 Sep '21, 20:43

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

That looks good to me! If you want, you can shorten it using nwr instead of node, way and relation:

[out:json][timeout:25];
(nwr["amenity"="restaurant"](around:100,{{geocodeCoords:Platz der Republik 1, 10557 Berlin}});) -> .results;
.results out center;

On https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries, the geocoding part is briefly outlined: geocodeCoords gives the coordinates of the centre of the first result which the search of the name resulted in. That might cause some problems if the name of the place is not well specified.

permanent link

answered 07 Sep '21, 13:15

G%C3%A5seborg's gravatar image

Gåseborg
31171016
accept rate: 50%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×483
×228
×16

question asked: 11 Jul '21, 22:29

question was seen: 3,409 times

last updated: 07 Sep '21, 20:43

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum