Overpass turbo/Examples

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Overpass turbo/Examples
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 bokmål norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português português do Brasil 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 беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

Here are some more Examples of interesting overpass queries.

You can click on the turbo icons (overpass turbo icon) for a direct link of the respective query on overpass turbo.

Complete route relation

This returns a complete route relation, in this case the hiking route "Meraner Höhenweg": try it yourself in overpass-turbo

result of this example
<osm-script output="json">
  <query type="relation" into="hr">
    <has-kv k="route" v="hiking"/>
    <has-kv k="name:de" v="Meraner Höhenweg"/>
  </query>
  <union>
    <item set="hr"/>
    <recurse from="hr" type="relation-way" into="hrp"/>
    <recurse from="hr" type="relation-node"/>
  </union>
  <print mode="body" order="quadtile"/>
  <recurse from="hrp" type="way-node"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Part of a (route) relation

This returns only those ways of a (long) route relation that lie in the current map bounding box: try it yourself in overpass-turbo

<osm-script output="json">
  <query type="relation" into="hr">
    <has-kv k="route" v="hiking"/>
    <has-kv k="ref" v="Hanse"/>
    <bbox-query {{bbox}}/>
  </query>
  <query type="way" into="hrp">
    <recurse from="hr" type="relation-way"/>
    <bbox-query {{bbox}}/>
  </query>
  <union>
    <item set="hr"/>
    <item set="hrp"/>
  </union>
  <print mode="body" order="quadtile"/>
  <recurse from="hrp" type="way-node"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Power substations without proper voltage tag

A query that shows all power substations that have a power line 30 meters from them, but don't have the corresponding voltage tag: try it yourself in overpass-turbo

<query type="way" into="400">
	<has-kv k="power" v="line"/>
	<has-kv k="voltage" v="400000"/>
	<bbox-query {{bbox}}/>
</query>
<query type="way" into="345">
	<has-kv k="power" v="line"/>
	<has-kv k="voltage" v="345000"/>
	<bbox-query {{bbox}}/>
</query>
<query type="way" into="220">
	<has-kv k="power" v="line"/>
<has-kv k="voltage" v="220000"/>
	<bbox-query {{bbox}}/>
</query>
<query type="way" into="110">
	<has-kv k="power" v="line"/>
	<has-kv k="voltage" v="110000"/>
	<bbox-query {{bbox}}/>
</query>
<union>
	<query type="way">
		<has-kv k="power" v="station"/>
		<bbox-query {{bbox}}/>
	</query>
	<query type="way">
		<around radius="30" from="400"/>
		<has-kv k="power" regv="sub_station|substation"/>
		<has-kv k="voltage" modv="not" regv="400000"/>
		<bbox-query {{bbox}}/>
	</query>
	<query type="way">
		<around radius="30" from="345"/>
		<has-kv k="power" regv="sub_station|substation"/>
		<has-kv k="voltage" modv="not" regv="345000"/>
		<bbox-query {{bbox}}/>
	</query>
	<query type="way">
		<around radius="30" from="220"/>
		<has-kv k="power" regv="sub_station|substation"/>
		<has-kv k="voltage" modv="not" regv="220000"/>
		<bbox-query {{bbox}}/>
	</query>
	<query type="way">
		<around radius="30" from="110"/>
		<has-kv k="power" regv="sub_station|substation"/>
		<has-kv k="voltage" modv="not" regv="110000"/>
		<bbox-query {{bbox}}/>
	</query>
</union>

<union>
	<item/>
	<recurse type="down"/>
</union>
<print/>

Living streets with a potentially wrong speed limit

An example for conflicting (or uncommon) tag combinations: highway=living_street AND maxspeed=30 try it yourself in overpass-turbo (same but simply with all maxspeed=* tags: try it yourself in overpass-turbo) seems to happen quite frequently due to copy & paste errors or re-tagging of "residential" streets. Living streets usually have no but only an untagged implicit speed limit. Of course a living street could really have a 30 km/h speed limit in reality – you should know that location or visit it before changing the tags.

Highways with lanes=1 but no other explaining tag

This example query try it yourself in overpass-turbo searches for highway=*-tagged (only major types) ways with lanes=1 but no other "explaining" tag (junction=roundabout, oneway=, traffic_calming=*) which may explain why there is only one lane despite these road types being usually 2 lanes. This may be a situation where one of the aforementioned tags may be missing. Be aware: This query will produce false positive hits (correctly mapped objects which still show up in this query)! You may want to adjust the query to e.g. also hit hits when other "explaining" tags are present or to exclude smaller highway types (e.g. unclassified, residential). Note that you should have local knowledge to fix those potential errors, so look at places you know.

Nodes that only have a name tag

This example query try it yourself in overpass-turbo searches for nodes that only have a tag with a name name=* with no other tags (like place=* amenity=*, leisure=*, or shop=*) that would describe the object. This query is useful for finding nodes that need to be properly tagged and this is missing in most QA tools like Osmose.


More

Overpass API by Example / DE:Overpass API/Beispielsammlung

Quality assurance of postal codes

Soldier Boy's Examples

Parking areas example

More various Overpass examples

Public transport Quality Assurance