[SOLVED] [OverpassTurbo] Querying with multiple tags?

Hello

I need to query OSM through OverpassTurbo to get all the bike cafés throughout the world.

Based on the wiki, I tried the following, but both failed:


[out:json][timeout:25];
(
  node["shop"="bicycle"];node["amenity"="cafe"]({{bbox}});
);
out body;
>;
out skel qt;

=> Query Error. An error occured during the execution of the overpass query! This is what overpass API returned: runtime error: Query timed out in “query” at line 3 after 26 seconds.


[out:json][timeout:25];
(node["shop"="bicycle"];node["amenity"="cafe"];);
out body;
>;
out skel qt;

=> Query Error. An error occured during the execution of the overpass query! This is what overpass API returned: runtime error: Query timed out in “query” at line 2 after 26 seconds.

Anybody knows?

Thank you.

Increasing the “25” in the first line might help. Especially when you are querying a large area. Or query a smaller area.
The 25 means that you think it will take at most 25 seconds to run the query. After 26 seconds the server tells you it takes longer and stops.

Thanks, but it still doesn’t work: I zoomed in on one street where I know there’s one with the right tags (“Look Mum, No Hands!” on Old Street in London), but the query still times out:


[out:json][timeout:25];
(
  node["shop"="bicycle"];node["amenity"="cafe"]({{bbox}});
  way["shop"="bicycle"];way["amenity"="cafe"]({{bbox}});
);
out body;
>;
out skel qt;

There’s probably no more than a hundred such places around the world: Is there an other way to query OSM?

this one http://overpass-turbo.eu/s/kb2 works at the moment.
Perhaps there was some hickup on the server ?

The problem with the query above, is that it returns all the cafés, and all the bike shops, while I need bike cafés only.

This is why I wanted to use multiple tags on each line, but it doesn’ work.

Try this http://overpass-turbo.eu/s/kb4
It’s a small difference from you query, but a big difference in results. :wink:

(If you want elements that have both tags then ask for both of them)
node[“shop”=“bicycle”][“amenity”=“cafe”] (bbox, area, … )
^ ^ ^
elem tag1 & tag2

Way to go!

Thank you very much.