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, 12:27

Katerina_Kourou's gravatar image

Katerina_Kourou
112
accept rate: 0%

edited 19 Feb, 13:01

scai's gravatar image

scai ♦
32.1k20294444


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, 13:03

maxerickson's gravatar image

maxerickson
12.4k1079174
accept rate: 31%

edited 19 Feb, 13:44

This worked! Thanks a lot :)

(19 Feb, 15:04) Katerina_Kourou
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:

×406
×166
×65

question asked: 19 Feb, 12:27

question was seen: 68 times

last updated: 19 Feb, 15:04

powered by OSQA