Is there a way i can count the number of houses/building in a given area?
Hi and welcome to the OSM-Community!
You can run an overpass query for all buildings (or just building=house
) in a selected area on the map:
[out:json][timeout:25];
nwr["building"]({{bbox}});
//nwr["building"="house"]({{bbox}});
out geom;
Another solution is to specify a specific area by name:
[out:json][timeout:25];
{{geocodeArea:Berlin}}->.searchArea;
nwr["building"](area.searchArea);
out geom;
You will then see the number of results in the bottom right.
The Ohsome Dashboard is also a fantastic way to get this info:
Especially if you want pretty charts.
How to Get a Count/Chart of Buildings In An Area
1. On the map, on the right-hand side, you can:
- Zoom in + Select the area you want.
2. On the left-hand side, in the various boxes…
You can type in:
- Key:
building
- Value: ``
- (If you only want
building=house
, then type inhouse
. Otherwise, leave value BLANK.)- (I prefer to leave it blank to get all building types… since the vaaaast majority of buildings are tagged as
building=yes
.)
- (I prefer to leave it blank to get all building types… since the vaaaast majority of buildings are tagged as
- (If you only want
3. Now choose the dropdowns:
- OSM Type:
node
way
relation
- By default it’s only “node”.
4. For “Group Results By…”:
- Choose the
tag
radio button. - Grouping Key:
building
- (If you don’t want graph split by types, leave this BLANK.)
5. For “Time Interval”:
- Choose Start and End Dates you want.
- Most of the time, I focus on the last year (so 2024->2025).
- Choose Period.
- In the dropdown, I usually select
monthly
orweekly
.
- In the dropdown, I usually select
6. Push the green “Run Query” button.
This is what it should look like after it’s all completed:
Here’s an example of all building
s in Philadelphia from 2024–2025:
You can see how ~520k have been mapped (compared to 360k at the beginning of 2024!)… but:
Num | Type |
---|---|
492.0k | building=yes |
15.2k | building=house |
3.0k | building=semidetached_house |
1.4k | building=detached |
1.3k | building=apartments |
[…] |
so 94.6% are just generic building=yes
, while ~2.9% are currently building=house
. Only ~5% are even marked with an actual non-default type.
Side Note: Another great resource is Geofabrik’s Taginfo:
It’s just like the general TagInfo website, but broken down into countries/states.
For example, here’s the # of building
s in Texas. There are currently:
- ~5.6 million
building
s in Texas.- ~3.5 million are
building=yes
. - ~1.7 million are
building=house
.
- ~3.5 million are
They seem to update every day, so you’ll get pretty accurate stats from the latest OSM data.