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

Querying tags with multiple values via Overpass

1

This example Overpass query for node["cuisine"="coffee_shop"] will not return nodes tagged "cuisine"="coffee_shop;sandwiches", i.e. with multiple values.

  1. Shouldn't it?
  2. Any workarounds?

asked 26 Feb '19, 17:18

robinmetral's gravatar image

robinmetral
1867718
accept rate: 0%


One Answer:

3

You can use a regular expression

node["cuisine"~"coffee_shop"]

I would also suggest looking for ways (and relations)

nwr["cuisine"~"coffee_shop"]

answered 26 Feb '19, 18:43

andrewblack's gravatar image

andrewblack
3651214
accept rate: 57%

Amazing @andrewblack, thanks! I didn't know of the nwr shortcut either, it's saving my query two lines 👍

(26 Feb '19, 19:16) robinmetral

nwr is fairly new. It makes it easier/safer to edit. How many times have I edited node and not way.

(26 Feb '19, 19:20) andrewblack

FYI there are 41732 coffee_shops in the world. Next step is dealing with this kind of data

(26 Feb '19, 19:32) robinmetral

Source code available on GitHub .