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

I'm trying to obtain list of supermarkets in Santa Clara in CA, USA. I've crafted following query:

area[name="California"]->.state;
area[name="Santa Clara"]->.city;
node(area.state)(area.city)[shop=supermarket];
out;

The problem is with cases that are inside Santa Clara (city) bounding box but doesn't have "city" or "state" values in their meta data.

Is there a way to search using bounding box instead of city name?

asked 18 Jun '22, 08:18

sebap123's gravatar image

sebap123
46225
accept rate: 0%


There appears to be two problems: 1. You were asking it to return just nodes. 'nwr' (nodes, ways, relations) returns all objects. 2. The out; statement returns all entities (click the Data tab), but only renders nodes. Never been sure if this is a bug or 'Expected behaviour'

area[name="California"]->.state;
area[name="Santa Clara"]->.city;
nwr(area.state)(area.city)[shop=supermarket];
out center;

If you're going to make repeated use of the routine, I've found it more efficient to directly use the city's id:

area(3602221647);
nwr[shop=supermarket](area);
out center;

Also, take a look at my similar answer which gives you multiple options to do the same thing.

https://help.openstreetmap.org/questions/84723/use-polygon-for-an-overpass-turbo-query

permanent link

answered 18 Jun '22, 13:42

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 18 Jun '22, 23:20

Your answer
toggle preview

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
×85

question asked: 18 Jun '22, 08:18

question was seen: 1,104 times

last updated: 18 Jun '22, 23:20

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