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

Hey guys, I am trying to find all restaurants inside a city or town like this on overpass turbo:

[out:json][timeout:25];
area["ISO3166-1"="AM"];
area(area)['name:en'~"^Ararat"]["place"="town"]->.a;
node(area.a)["amenity"="restaurant"];
out qt;

but its result is empty, if I am using the relation :

[out:json][timeout:25];
area["ISO3166-1"="AM"]->.b;
rel(area.b)['name:en'~"^Ararat"];
out geom;
{{style: 
  area
  { color:gray; fill-color:DarkGray; }
}}
map_to_area;
node(area)["amenity"="restaurant"];
out qt;

there is 1 restaurant inside Ararat town alt text

What is the difference between the 2 queries? and how can I show restaurants inside cities or towns? not inside province or state!

asked 22 Mar '23, 08:59

alt2020's gravatar image

alt2020
11335
accept rate: 0%

1

Which specific area/province do you wish to search? Your search criteria is ambiguous ('name:en'~"^Ararat") The restaurant you highlight isn't in a town try [place~"town|village|city"]

(22 Mar '23, 15:19) DaveF

do I need to search first a province first? and after that, I have to search the town and then In town, I have to search restaurant.Ararat is a town in Ararat province, @DaveF

(22 Mar '23, 18:51) alt2020

I chenged query ti this [out:json][timeout:25]; area["ISO3166-1"="AM"]; area(area)[place~"town|village|city"]->.a; area(area.a)['name:en'~"^Ararat"]->.b; node(area.b)["amenity"="restaurant"]; out qt; but my query result is all restaurants inside Ararat province, I just want all restaurant inside Ararat town. https://overpass-turbo.eu/s/1sLq @DaveF

(22 Mar '23, 18:56) alt2020

I think it depends how the town is defined. If there's a town boundary, then things will be much easier compared to a node. Unless all the restaurants' address have place:city(or town) = ararat specified.

(24 Mar '23, 03:49) kucai
1

You will need to include ways and relations as object types too.

(01 Apr '23, 17:37) SimonPoole ♦

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:

×710
×228

question asked: 22 Mar '23, 08:59

question was seen: 756 times

last updated: 01 Apr '23, 17:37

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