Getting the bounding box of the current view
The following query gets the bounding box of the «current view» (for example <bounds minlat="48.3617240" minlon="-3.7847900" maxlat="49.8999421" maxlon="-0.0494385"/>
). This is handy when scrolling and zooming to a view and then use the values for a later query.
[bbox:{{bbox}}];
out;
Such a query produces a result like:
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.61.5 4133829e">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2023-11-12T16:38:30Z"/>
<bounds minlat="45.7854820" minlon="7.4607422" maxlat="46.0794229" maxlon="7.9413940"/>
</osm>
See also the
out bb
statement.