Estimating Population with OpenStreetMap
Estimating how many people live within a specific area is a recurring challenge in public health, urban planning, and humanitarian work. Census data is often outdated, too coarse, or unavailable at the scale decision-makers need. A new open-source map created by Carlos Felipe Castillo shows how far you can get using nothing more than OpenStreetMap data and lightweight analytics.
Carlos has built an interactive population estimation tool using Streamlit, Folium, and the Overpass API, allowing users to draw an area directly on a map and instantly estimate the number of people living within it.
Querying OpenStreetMap in real time
Instead of relying on preloaded datasets, the map sends a targeted query to the Overpass API, requesting only buildings within the drawn polygon. Then, using computational geometry, the tool calculates building footprints with geodetic accuracy, avoiding underestimation caused by map projection distortion.
Population is inferred by combining:
- Building footprint size
- Number of levels (floors)
- Assumed housing density
Inspired by Carlos's approach I decided to create a similar tool for US cities. My USA Population Estimator uses OpenStreetMap building data to estimate how many people live within a user-defined area - directly in the browser and in real time.
Like Carlos Castillo’s original Streamlit application, my map is based on the idea that building footprints, height information, and simple occupancy assumptions can be combined to produce fast, fine-grained population estimates.
The USA Population Estimator allows users to:
- Draw a polygon on the map to define any area of interest
- Query OpenStreetMap in real time using the Overpass API
- Extract residential building footprints and height data
- Estimate population based on total residential floor area
- Display both a population estimate and a confidence score
The tool is designed for exploratory analysis - it does not use official statistics and only provides a calculated estimate of an area's population. While the estimator can technically be used anywhere in the world where OpenStreetMap building data exists, it is tuned for US cities through its default assumptions:
- Average residential floor area per person reflects US housing norms
- Building type filters prioritize US-style residential tagging
- Mixed-use buildings are handled conservatively to avoid commercial overcounting
- Residential buildings are selected
Only buildings tagged as residential (e.g. house, apartments) are included. - Building footprint area is calculated
Each building’s footprint is measured from its polygon geometry. - Vertical space is added
If available, height or building:levels is used.
Otherwise, a conservative default is applied. - Residential efficiency is applied
Not all floor space is assumed to be living area; all estimated shared spaces are discounted. - Population is estimated
Total residential floor area is divided by an average square-meters-per-person value.
- Buildings include measured height or floor count
- Buildings are explicitly tagged as residential
- Fewer default assumptions are required
- Heights or levels are missing
- Generic building tags are used
- Defaults are applied frequently



Comments