Overpass is a read-only query service for OpenStreetMap. Select nodes, ways and relations by tags and a geographic boundary; retain the query and extraction date with the response.
Define a query
An Overpass bounding box is ordered south, west, north, east. GeoJSON positions use longitude, latitude. For the Temane example, (-22.25,34.95,-21.5,35.35) selects a rectangle in southern Mozambique.
nwr["amenity"="school"](bbox); selects school-tagged nodes, ways and relations. Combine alternatives in parentheses. out geom; returns geometry; out center tags; supplies a representative point for ways and relations, not their footprint. Do not use those points for polygon intersection or area calculations.
Fetch and retain the response
Write the query to query.overpassql, then submit it deliberately:
curl --fail --data-urlencode data@query.overpassql \
https://overpass-api.de/api/interpreter > response.json
Overpass JSON is not GeoJSON. Convert it with an OSM-aware converter that assembles ways and relations, and retain OSM element type and ID. Keep the original response, query, endpoint and timestamp.
Inspect before expanding
Check returned tag combinations and geometry types. Health facilities may use amenity or healthcare; a place point and a residential polygon describe different objects. Deduplicate overlapping requests by element type plus ID. An empty response establishes no matches for that query, not absence of facilities.
Use a bulk OSM extract for large or repeated regional processing. Public Overpass endpoints have shared capacity; narrow queries and respect their usage limits.
Temane query and retained sample
The examples below construct query text and display attached Temane extracts. They do not run a new Overpass request when this article opens.
References and related work
Overpass QL reference · OSM copyright and ODbL · Normalization workflow