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

How the population estimate is calculated

At its core, the estimator uses a floor-area–based model:
  1. Residential buildings are selected
    Only buildings tagged as residential (e.g. house, apartments) are included.
  2. Building footprint area is calculated
    Each building’s footprint is measured from its polygon geometry.
  3. Vertical space is added
    If available, height or building:levels is used.
    Otherwise, a conservative default is applied.
  4. Residential efficiency is applied
    Not all floor space is assumed to be living area; all estimated shared spaces are discounted.
  5. Population is estimated
    Total residential floor area is divided by an average square-meters-per-person value.
This approach mirrors methods often used in urban studies when household-level data is unavailable.

How the confidence score is calculated

In addition to the population estimate, the map provides a confidence score that reflects data completeness, not population accuracy.

The score increases when:
  • Buildings include measured height or floor count
  • Buildings are explicitly tagged as residential
  • Fewer default assumptions are required
The score decreases when:
  • Heights or levels are missing
  • Generic building tags are used
  • Defaults are applied frequently
The final score is the average confidence across all buildings in the selected area, expressed as a percentage. A higher score means the estimate relies more on observed data and less on assumptions.

You can clone the map from its GitHub repository and adapt it for use in other countries by adjusting the default assumptions - such as average residential floor area per person, typical building heights, and residential efficiency - to reflect local housing characteristics.

Note:

For official population figures, the U.S. Census Bureau’s Census Business Builder provides census-based estimates for towns, zip-code areas or census tracts.

Comments

Popular Posts