Search notes:

Overpass API queries

Find just everything

The following query uses nwr (a shorthand for node, way and relation)) to find just everything in the area visible in Overpass turbo. I like this because makes nodes and ways clickable and I can quickly get some information about a (small) area:
[bbox: {{bbox}} ];
nwr;
out;

Shops

The following query tries to find «non-specialized» shops.
Because amenity=shops is deprecated in favor of shop=… but might still be in the OSM database, the query combines amenity=shop with shop=… with a union clause (the two statements within the parantheses).
Furthermore, the query also uses a regular expression alternative to search for both, shop=convenience and/or shop=supermarket.
[bbox: {{bbox}} ];

(
   nw[shop    ~'^(convenience|supermarket)'] ;
   nw[amenity ='shop'                      ] ;
);

out geom;

Interesting natural objects

Find interesting natural objects.
Trees, scrub etc. are of little interest for me. Therefore, the following query excludes these objects from all nodes or ways that have the natural tag:
[bbox: {{bbox}} ];

nw[natural     ] -> .res;

   ( .res; - nw[natural=bare_rock];) -> .res;
   ( .res; - nw[natural=cliff    ];) -> .res;
   ( .res; - nw[natural=grassland];) -> .res;
   ( .res; - nw[natural=peak     ];) -> .res;
   ( .res; - nw[natural=sand     ];) -> .res; // in combination with golf=bunker
   ( .res; - nw[natural=scree    ];) -> .res;
   ( .res; - nw[natural=scrub    ];) -> .res;
   ( .res; - nw[natural=shrub    ];) -> .res;
   ( .res; - nw[natural=shrubbery];) -> .res;
// ( .res; - nw[natural=stone    ];) -> .res;
   ( .res; - nw[natural=tree     ];) -> .res;
   ( .res; - nw[natural=tree_row ];) -> .res;
   ( .res; - nw[natural=water    ];) -> .res;
   ( .res; - nw[natural=wetland  ];) -> .res;
   ( .res; - nw[natural=wood     ];) -> .res;


.res out geom;

Searching for a specific historic period (civilization)

The following query searches for all nodes/ways with a historic:civilization tag and excludes some that I currently find uninteressing (such as WW1 or modern):
[bbox: {{bbox}} ];

nw['historic:civilization'     ] -> .res;

// ( .res; - nw['historic:civilization'='prehistoric'        ];) -> .res;
// ( .res; - nw['historic:civilization'='paleolithic'        ];) -> .res;
// ( .res; - nw['historic:civilization'='mesolithic'         ];) -> .res;
// ( .res; - nw['historic:civilization'='neolithic'          ];) -> .res;
// ( .res; - nw['historic:civilization'='megalith'           ];) -> .res;
   ( .res; - nw['historic:civilization'='bronze-age'         ];) -> .res;
   ( .res; - nw['historic:civilization'='iron-age'           ];) -> .res;
// ( .res; - nw['historic:civilization'='celtic'             ];) -> .res;
   ( .res; - nw['historic:civilization'='german'             ];) -> .res;
   ( .res; - nw['historic:civilization'='ancient_roman'      ];) -> .res;
   ( .res; - nw['historic:civilization'='roman'              ];) -> .res;
   ( .res; - nw['historic:civilization'='gallo-romain'       ];) -> .res;
   ( .res; - nw['historic:civilization'='medieval'           ];) -> .res;
   ( .res; - nw['historic:civilization'='middle-ages'        ];) -> .res;
   ( .res; - nw['historic:civilization'='Renaissance'        ];) -> .res;
   ( .res; - nw['historic:civilization'='early-modern'       ];) -> .res;
   ( .res; - nw['historic:civilization'='early_modern'       ];) -> .res; // early_modern vs early-modern
   ( .res; - nw['historic:civilization'='modern'             ];) -> .res;
   ( .res; - nw['historic:civilization'='WW1'                ];) -> .res;
   ( .res; - nw['historic:civilization'='1._weltkrieg'       ];) -> .res; // Should this not be WW1 ?
   ( .res; - nw['historic:civilization'='1°_guerra_mondiale' ];) -> .res; // Should this not be WW1 ?
   ( .res; - nw['historic:civilization'='wk1'                ];) -> .res; // Should this not be WW1 ?
   ( .res; - nw['historic:civilization'='world_war_2'        ];) -> .res;

   ( .res; - nw['historic:civilization'='westwall'           ];) -> .res; // What is westwall?
   ( .res; - nw['historic:civilization'='unknown'            ];) -> .res;

.res out geom;

Tourism

The following query finds nodes and ways having the tourism tag-keys and filters out undesired tag-values.
This query is a variant of the two queries above in that it doesn't use the minus operator, but rather combines not equal predicates in one query:
[bbox: {{bbox}}];

nw [tourism                ]
   [tourism != alpine_hut    ] // <--
   [tourism != artwork       ]
   [tourism != apartment     ]
// [tourism != attraction    ] // <--
   [tourism != camp_site     ]
   [tourism != caravan_site  ]
   [tourism != chalet        ]
   [tourism != gallery       ]
   [tourism != guest_house   ]
   [tourism != hotel         ]
   [tourism != hostel        ]
   [tourism != information   ]
   [tourism != motel         ]
   [tourism != museum        ]
   [tourism != picnic_site   ] // <--
   [tourism != resort        ]
   [tourism != viewpoint     ] // <-- Compare with tower:type=observation
   [tourism != wilderness_hut]
   [tourism != yes           ]
   [tourism != zoo           ] // <--
;

out geom;

Megaliths

[bbox: {{bbox}} ];

( nw[site_type = megalith] ;
  nw[megalith_type       ] ;
);

out geom;

List of countries

The following query produces the list of countries in CSV format (using a vertical bar (|) instead of a comma to separate the fields):
[out:csv(::id,name,'name:en','ISO3166-1',wikidata;
    false;  // No header
   '|'      // Seperator
)];

relation
   [admin_level='2']
   ["ISO3166-1"~"^..$"];

out;
The result of a variation of this query is rendered here.

CERN: Large Hadron Collider (LHC) / Super Proton Synchroton (SPS)

CERN's Large Hadron Collider and Super Proton Synchroton are not shown on an ordinary rendering on OpenStreetMap (because the value of layer is negative?), but can be shown with the following Overpass query:
way[highway=corridor](46.2,5.8,46.31,6.13);
(._;>;);
out body;
Link to map

See also

Overpass API

Index