Template:Overpass turbo example

From OpenStreetMap Wiki
Jump to navigation Jump to search
[Edit] [Purge] Template-info.svg Template documentation


Use overpass turbo ⟶ Export ⟶ section Queryosm wikidownload or copy to create a query with special wiki syntax.

Template to generate overpass turbo examples for Wiki pages.


  • display Overpass query source code in a source code box as-is
  • adds a small Overpass Turbo icon to the upper right corner of the source code box. This icon directly links Overpass turbo without having to create dedicated overpass turbo sharelinks in the first place.

Please write to User:mmd, if you have any suggestions or questions to this template.


Parameter Description Additional hints
Required parameter
query Overpass QL or Overpass XML query Note : overpass turbo shortcuts needs to be properly escaped via {{((}}bbox{{))}}, any "|" (pipe) character in regular expression needs be rewritten as {{!}}
Optional parameter
loc Map Location & Zoom as defined for overpass turbo. Only provide lat/lon/zoom level for parameter loc. Example: loc=47.0618984;15.4370248;17


    area.a[name][boundary=administrative][admin_level~"^[2-8]$"] -> .a;
    convert node ::=::,
              ::id = id(),
              is_in=a.set("{" + t[admin_level] + ":" + t[name] + "}");

Set the map viewport to New York by using the loc parameter:

way[highway][name="6th Avenue"];node(w)->.n1;
way[highway][name="West 23rd Street"];node(w)->.n2;
out meta;


This template will create an Overpass API example query, which is presented on a wiki page with syntax highlighting and a direct link to test and execute the query in overpass turbo.

Template parameters

This template prefers inline formatting of parameters.

Overpass API query with overpass turbo extensionsquery 1

Use overpass turbo --> Export --> Query --> download/copy as osm wiki to create a query with special wiki syntax. To update an existing query, load the respective query first into overpass turbo, apply the changes, and export the query in wiki syntax in the same way.

Location informationloc 2

lat;lon;zoom level

runrun 3

Automatically execute query in overpass turbo

syntax highlight langlang

xml -> xml; ql -> c/cpp; json -> json


See also