Missing Buildings from Overpass Turbo Query: Causes and Fixes
When working with OpenStreetMap (OSM) data, Overpass Turbo is the gold standard for data extraction. However, it is common for beginners and professionals alike to find that some buildings are missing from their query results, even when they are clearly visible on the OSM map.
If your GIS workflow is being hindered by incomplete data, here are the primary reasons your buildings might be missing and the code snippets to fix them.
1. The "Way" vs. "Relation" Pitfall
In OSM, buildings are rarely mapped as "nodes." They are almost always "ways" (polygons) or "relations" (multipolygons for complex buildings with holes or courtyards). If your query only searches for way["building"], you will miss every complex structure mapped as a relation.
The Fix: Use the "nwr" Shorthand
Instead of specifying node or way, use nwr (node, way, relation) to capture all possible building types in one sweep.
nwr"building";
2. Missing Recursion (The "Missing Geometry" Problem)
If you are exporting data to QGIS or ArcGIS and the buildings appear as empty entries in the attribute table without shapes, you likely forgot to recurse. A way or relation is just a list of ID numbers; you need to tell the Overpass API to "down-download" the coordinates for the nodes that make up those shapes.
The Fix: Add Recursion Arrows
Add (.; >;); before your output statement to include all constituent nodes.
( nwr"building"; );
(.; >;);
out body;
3. Tagging Variations: Beyond "building=yes"
While most buildings use the building=yes tag, many use specific values like building=apartments, building=retail, or building=house. Furthermore, some buildings might be tagged with abandoned:building=yes or have lifecycle prefixes that your query is ignoring.
The Fix: Use Key-Existence Checks
Instead of searching for a specific value, search for the existence of the "building" key regardless of its value:
nwr"building";
4. Server-Side Limits: Timeouts and Memory
If you are querying a large city like New York or London, the Overpass API might cut off your results early because the query exceeded the timeout or maxsize (memory) limits. In these cases, the map might look partially populated.
The Fix: Increase Query Resources
Add settings to the top of your script to allow for more processing power:
[out:json][timeout:90][maxsize:1073741824];
5. Data Latency (The "Minutely" Gap)
OpenStreetMap is a live database. If you just added a building in the iD Editor or JOSM, it may take a few minutes to an hour for the Overpass API mirrors to sync. If a building is missing, check the "Data Updated" timestamp at the bottom right of the Overpass Turbo interface.
Summary Checklist for GIS Professionals
- Are you using nwr instead of just way?
- Did you include the recursion ( > ) to get the node coordinates?
- Is your Bounding Box (%7B%7Bbbox%7D%7D) covering the entire study area?
- Have you checked for lifecycle tags (e.g.,
demolished:building)?
By implementing these changes, you ensure that your Geographic Information System analysis is based on the most complete dataset available from OpenStreetMap.
