Overpass turbo/Wizard

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Overpass turbo/Wizard
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް
Overpass API logo.svg
Overpass API · Language reference · Language guide · Technical terms · Areas · Query examples · Advanced examples · Sparse Editing · Permanent ID · FAQ · more · Web site
Servers status · Versions · Development · Technical design · Installation · XAPI compatibility layer · Public transport sketch lines · Applications · Source code and issues
Overpass turbo · Wizard · Overpass turbo shortcuts · MapCSS stylesheets · Export to GeoJSON · more · Development · Source code and issues · Web site
Visit overpass-turbo.eu and follow these steps:
1. Select the Wizard from the toolbar
2. Enter what you want to get
3. Hit the button
4. Enjoy the result


Writing Overpass queries can sometimes be a quite tedious, repetitive work that requires knowledge of the Overpass query language in the first place. overpass turbo's Query Wizard helps you by converting simple, human readable search terms into functional Overpass queries. Here is an example: To get drinking water fountains, now all you have to do is fire up the Wizard and type in the appropriate tag amenity=drinking_water, instead of writing down a multi-line Overpass query.

The syntax the Wizard understands is inspired by JOSM's search/filter functions. A search consists of individual filter expressions, for example key=value (for a simple tag search) or type:node (to restrict the result to only nodes). Those can be combined together with logical operations like and or or. Take a look at the following examples:

  • tourism=hotel
  • amenity=drinking_water and type:node
  • (highway=primary or highway=secondary) and type:way

By default, data is searched in the current map viewport. But the Wizard also understands some other location filters. Here is an example of how to search in a certain city:

  • tourism=museum in Vienna

Tag Searches

selector description


Matches objects that have a tag with key key and the value value.
key:valuefragment Matches objects that have a tag with key key and whose value contains the string valuefragment.

key like regex

Matches objects that have a tag with key key and whose value matches the regular expression regex.


Matches objects that have a tag with a key that matches the regular expression keyregex and whose value matches the regular expression regex.

key is not null

Matches objects that have a tag with key key.


Matches objects that do not have a tag with key key and the value value.

key not like value

a) objects that have a tag with key key and whose value does not match the regular expression regex
b) objects that do not have a tag with key key

key is null

Matches objects that do not have a tag with the key key.

If a string (for example the value of one of the tag-selectors above) contains whitespace or other special characters (such as colons, dashes, non-ascii characters, etc.) it must be enclosed in quotes:

  • name="New York"
  • "addr:housenumber" = *

Regular expressions can be provided either as plain strings or with the well known regex notation:

  • ref ~ "[0-9]+"
  • name ~ /street$/i (the modifier i makes the match case-insensitive)

Intelligent Wizard

Instead of tag searches, one can also just filter by object categories. For example one can use the terms Hotel, "Drinking Water", Hospital, etc. instead of the corresponding tags. This works for all objects for which a preset is defined in the iD editor.

Meta-Data Filters

selector description
type:osm-type Matches objects that have the type osm-type (node, way or relation).
id:osm-id Matches objects that have the id osm-id.
user:osm-user Matches objects that were last modified by user osm-user.
uid:osm-uid Matches objects that were last modified by a user with the user-id osm-uid.
newer:date Matches objects that have been added or modified more recently than date.

The parameter date for the newer selector can be either an ISO 8601 time string (e.g. "2013-11-24T19:01:00Z") or a relative date which indicates the relative amount of time in the past:

  • newer:1day (selects everything that has been added or modified in the last 24 hours)
  • newer:"4 weeks" (selects everything that has been added or modified in the last 4 weeks)

Allowed time units are: second(s), minute(s), hour(s), day(s), week(s), month(s) and year(s).

Location Filters

By default, the Wizard creates queries that search in the current map view-port (via a <bbox-query {{bbox}}/>). By specifying a location filter at the end of the search you can also search in different places or even globally:

selector description
in bbox (default) Matches objects that are inside the current map view-port.
in place Matches objects that are inside an area with the name place.
around place Matches objects that are in the vicinity of an object with the name place.
global Matches objects globally, without any restriction by location. For results falling outside the current view-port, use the Zoom to Data control to locate it.

The place-names mentioned above are passed though a Nominatim search first. That means, you can use any place name that you can also use on OSM's search box, like town names, POIs, addresses, etc.

  • tourism=museum in Vienna
  • amenity=restaurant around "1600 Pennsylvania Ave NW, Washington"
  • tourism=attraction around "Riesenrad, Wien"

Boolean Operators

operator description
X or Y

X || Y, X | Y

Matches when either the objects that have a tag with key key and the value value.
X and Y

X && Y, X & Y

Matches when either the objects that have a tag with key key and the value value.

All boolean operators can be used with braces to change operator priorities:

  • (highway=bus_stop or railway=platform) and shelter=yes

Wizard filled by URL-parameter

You can create links to overpass turbo that use the query wizard to create a query (which is loaded on startup and presentet to the user). An example is http://overpass-turbo.eu/?w=pub+in+dublin. Such URLs to overpass turbo are both quite short and at least somewhat human readable.

By appending &R to this link, the query will be executed immediately and query results are shown on the map. Example: http://overpass-turbo.eu/?w=pub+in+dublin&R

This feature is also utilized by the search engine DuckDuckGo: You can simply type your query in their search box accompanied by !otw (which stands for "Overpass Turbo Wizard") and when starting the search you are immediately taken to the overpass turbo page with the query you entered.

You can use wildcards

You would like to see all ham-radio repeater in a certain region in Germany. The callsigns of the ham-radio repeater in Germany start all with: DB0* examples: DB0XS, DB0SR ... and the callsigns are located in the name tag.

Solution: Use this regular expression: name~"^DB0.*".

So far, when searching for a tag that consists of key=value, wildcards are only possible when defining the value of a tag, you cannot apply any wildcard to the key. Feature to search also for a key via regex is available now, see above.


By default, [timeout:25] is part of the query. It means that query will be stopped after running for 25 seconds. In some situations one may wish to increase this value to allow querries to run for a longer time.


With in-browser use of Overpass turbo Wizard it is impossible to cause too much traffic on servers (except deliberately malicious use). See Overpass_API#Introduction ("You can safely assume...")

Technical Details

The wizard defines its own grammar (written in PEG.js, a simple parser generator for JavaScript). The parsed query (a tree of boolean operations and filters) is then normalized into disjunctive normal form (A∧B∧…) ∨ (X∧Y∧…) ∨ … which is much easier to represent as an Overpass query (i.e. a simple union of queries). After that, an annotated Overpass QL query is constructed quite trivially. For some filters special query-shortcuts (such as {{geocodeArea:*}} for an … in Area search) are used.