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
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
11●3●3●5
accept rate:
0%
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"]
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
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 @DaveFI 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.
You will need to include ways and relations as object types too.