This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Query locations by type, export?

0

Hi! Is there a way to query malls within a certain geographic area, and export a list, perhaps as a CSV?

asked 15 Nov '19, 22:23

NickMoreau's gravatar image

NickMoreau
51224
accept rate: 0%


One Answer:

0

Overpass-API is good for this type of query. Here's a quick example using Overpass Turbo to select the area of the query:

[out:csv(name,::lat,::lon)][bbox:{{bbox}}];
nwr[shop=mall];
out center;

It may be necessary to add more tags to really find all malls, depending on how they are tagged in the area of interest. This can be done by replacing the nwr[shop=mall]; line with a union. For example, this query also returns areas tagged as commercial landuse:

[out:csv(name,::lat,::lon)][bbox:{{bbox}}];
(
  nwr[shop=mall];
  nwr[landuse=commercial];
);
out center;

You may also want to add additional tags to the csv() block. Each one will show up as a column in the result.

answered 15 Nov '19, 23:28

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Wonderful, thank you! I'll try this out.

I have minimal coding experience -- enough to understand and modify your code, but not enough to start from scratch -- so I'm extremely grateful for your help.

(16 Nov '19, 13:00) NickMoreau

For a beginner the wizard on the Overpass Turbo does a good job. Open the wizard, fill in what you are looking for, "mall" in your case, and klick create query. Then run it.

(16 Nov '19, 13:19) TZorn

Source code available on GitHub .