Why not ask your question on the new OpenStreetMap Community Forum?


I need the following: I'm searching for restaurants around "95448 Bayreuth" (Germany) 1000 meters.

This is what I got so far, it works nearly, but it shows also restaurants outside the 1000 meters radius:

// fetch area "Bonn" to search in
{{geocodeArea:95448 Bayreuth}}->.searchArea;
// gather results
  // query part for: "restaurant"
// print results
out body;
out skel qt;

May you help me with that, please?

asked 10 Jul '21, 16:28

alpham8's gravatar image

accept rate: 0%

edited 10 Jul '21, 16:37

Please clarify what you mean by 95448 Bayreuth as that is a boundary. {{geocodeArea:95448 Bayreuth}}; rel(pivot); out geom;

(10 Jul '21, 19:59) DaveF

There are a number of issues with your search:

  1. You are searching for all restaurants mapped as a node which are in the entire Gemeinde of Bayreuth + those 1000 m outside that boundary. You need to find the node representing the centre of Bayreuth not the area.
  2. Additionally you are finding any Restaurants mapped as areas within (but not outside) Bayreuth (the around constraint is not applied to ways & areas.

This appears to be closer to what you want:

// gather results
  // query part for: “name=Bayreuth”
// print results
out body;
out skel qt;

The place node for Bayreuth is places in a result set & that set is searched for restaurants within 1000 m. If there is more than one place with the name other approaches may be needed.

permanent link

answered 10 Jul '21, 19:34

SK53's gravatar image

SK53 ♦
accept rate: 22%

If you want all restaurants within the boundary of Bayreuth:

{{geocodeArea:95448 Bayreuth}}->.Bayreuth;
out geom;
out center;

If you want all restaurants around the node of the town.

out center;
permanent link

answered 10 Jul '21, 20:15

DaveF's gravatar image

accept rate: 16%

Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 10 Jul '21, 16:28

question was seen: 999 times

last updated: 10 Jul '21, 20:17

powered by OSQA