Template:Overpass turbo example/doc
This is a documentation subpage for Template:Overpass turbo example. It contains usage information, categories and other content or metadata that is not part of the original template. |
Introduction
Use overpass turbo ⟶ Export ⟶ section Query ⟶ osm wiki ⟶ download or copy to create a query with special wiki syntax.
Template to generate overpass turbo examples for Wiki pages.
Features:
- 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.
Usage
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
|
Examples
{{OverpassTurboExample|query=
node({{((}}bbox{{))}})[place=village];
foreach(
is_in->.a;
area.a[name][boundary=administrative][admin_level~"^[2-8]$"] -> .a;
convert node ::=::,
::id = id(),
is_in=a.set("{" + t[admin_level] + ":" + t[name] + "}");
out;
);
}}
Set the map viewport to New York by using the loc
parameter:
{{OverpassTurboExample|loc=40.7553;-73.9638;13|query=
[bbox:{{((}}bbox{{))}}];
way[highway][name="6th Avenue"];node(w)->.n1;
way[highway][name="West 23rd Street"];node(w)->.n2;
node.n1.n2;
out meta;
}}
TemplateData
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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Overpass API query with overpass turbo extensions | query 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. | String | required |
Location information | loc 2 | lat;lon;zoom level | String | optional |
run | run 3 | Automatically execute query in overpass turbo | Boolean | optional |
syntax highlight lang | lang | xml -> xml; ql -> c/cpp; json -> json | Unknown | optional |
Endpoint | endpoint | URL to Overpass turbo
| Unknown | optional |
collapsed | collapsed | no description | Unknown | optional |
See also
- {{OverpassTurboRosetta}}: show one example in many languages parallel to each other
- {{OverpassUltraExample}} and {{OverpassUltraV2Example}}: an alternative Overpass API frontend that supports different visualizations on a vector map