OpenStreetMap

The Overpass Query Wizard

Posted by tyr_asd on 12 December 2013 in English.

overpass turbo is a helpful tool for hundreds of mappers every week. But it could be an even better tool for even more people if only there was a way to assist with the creation of actual overpass queries. You know that it’s quite tedious to type all those queries that are mostly the same all the time. Not to mention that one must remember all those overpass statements and their parameters all the time.

But here comes a way that makes overpass turbo both easier to use for beginners as well as quicker to use for experienced data-miners:

The Query Wizard

Designed to transform simple, human-readable search terms into functional Overpass queries.

Here is an example: To get restaurants, now all you have to do is fire up the Wizard from the tool-bar (or using the keyboard-shortcut Ctrl+I) and type in the appropriate tag amenity=restaurant:

Query Wizard in action

The wizard is quite powerfull: It understands different kinds of tag searches as well as some meta data filters which can be joined together with logical operations like and or or.

By default, data is searched in the current map viewport. But the Wizard also recognizes some other location filters. For example, you can simply write tourism=museum in Vienna and the query will work just magically.

Query Wizard in action

Read the Wiki for more details and technical background.

New Overpass-Shortcuts

If you tried the museums in Vienna example (tourism=museum in Vienna) from above, you may have noticed the following line in the produced Overpass query:

<id-query {{nominatimArea:Vienna}} into="area"/>

As the Overpass API doesn’t really know which Vienna it should use to search in, we ask Nominatim instead. The {{nominatimArea:Vienna}} part is then replaced with the details of the Nominatim search results (just like {{bbox}} is replaced with the bounding box coordinates).

Appart from the just mentioned nominatim-shortcut (which actully comes in several flavours depending on your use-case) there is also a new {{date:*}} shortcut, which allows one to specify relative dates (typical use-case: <newer than="{{date:1 week}}"/>). Read more in the docs.

What else is new

You can now inspect tiny features more easily by zooming in one more level (overscaling): Like here for the smallest house of Vienna:

PS: You can now Flattr my project, if you want. Flattr

Discussion

Comment from NZGraham on 12 December 2013 at 19:19

What an excellent addition to Overpass Turbo - thank you so much from a ‘non geek’ user! I can now find all the bicycle friendly routes in one hit by entering “highway=cycleway or cycleway=lane or bicycle=yes or bicycle=designated”. I have also been mapping historic information about buildings here in Hamilton (New Zealand) using ‘building=historic’ and ‘old_name=*’ Being able to search for both sets of parameters at the same time is great. I’m just wondering how may more uses I’ll find for the wizard! Graham

Comment from AlaskaDave on 13 December 2013 at 02:31

This is an awesome tool! Thank you.

I have used Overpass Turbo in the past and did find constructing queries to be both tedious and irksome. This tool makes it SO MUCH EASIER.

Excellent!

Comment from NZGraham on 13 December 2013 at 04:52

Just an edit to my previous post ……. ‘building=historic’ is wrong - please replace with ‘historic=heritage_building’. Graham

Comment from malenki on 1 January 2014 at 11:54

Nice description of an even nicer Tool - thanks!

Is it also possible to change the color of the output or do I have to play with JS and openlayers/leaflet myself to do so?

Comment from tyr_asd on 1 January 2014 at 13:20

malenki, you can use MapCSS in overpass turbo to customize the colours (and more) of the output: http://www.openstreetmap.org/user/tyr_asd/diary/19043

Log in to leave a comment