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

Hello,

I'm trying to query all the "mall" and "department_store" for the key "shop" using the Overpass API and the following query:

[out:json];
area[name="London"];
nwr['shop'='department_store'](area);
out center;
nwr['shop'='mall'](area);
out center;

This however gives me only department_store because I put it first. So, basically it returns only the first shop I ask.

I also tried with the pyrosm package from Python. When I query for all shops it returns around 3330 records, but when I query to get both all shops and some amenities the records are less which doesn't make sense.

Any help please? :)

asked 19 Feb '21, 12:27

Katerina_Kourou's gravatar image

Katerina_Kourou
26445
accept rate: 0%

edited 19 Feb '21, 13:01

scai's gravatar image

scai ♦
33.3k21309459


The result of the first shop query is stored in the default set, which the second query is written to use for the search area. Storing the area results to a named set makes it available for multiple queries:

[out:json];
area[name="London"]->.search;
nwr['shop'='department_store'](area.search);
out center;
nwr['shop'='mall'](area.search);
out center;

In general, any statement without a named result set is stored in the default set, and any statement that takes an input (like area) will use the default set if a named set is not specified.

permanent link

answered 19 Feb '21, 13:03

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 19 Feb '21, 13:44

This worked! Thanks a lot :)

(19 Feb '21, 15:04) Katerina_Kourou

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
×191
×71

question asked: 19 Feb '21, 12:27

question was seen: 1,825 times

last updated: 19 Feb '21, 15:04

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