Skip to content

pycensus.census.worldwide.gba.population

A population source from built floor area: people per built m2 (calibrated on WorldPop and the census) x built m2, on WorldPop's grid.

from pycensus.census.worldwide.gba import built_surface_population
est, info = built_surface_population(built, worldpop, profile, census=census_polys, census_col="population", out_tif="...")

built / worldpop: arrays on the same grid (gba.metrics.built_area_raster onto the WorldPop raster). Per pixel:

  • inside a census polygon k: its census total C_k spread by built area, C_k * B / sum_k(B) (rate r_k = C_k / sum_k(B) people per built m2); a polygon without detected buildings keeps WorldPop's pattern, scaled to C_k;
  • outside the census (or with no census): WorldPop where it agrees with the built area (W >= min_ratio * r * B); where WorldPop is missing or far too low for what is built ("incongruent", e.g. villages WorldPop's settlement mask misses) r * B, with r the LOCAL rate: the built-area-weighted rate of the k_nearest census polygons (people per m2 differ a lot between, say, a city of apartment blocks and a town of large-family houses), or -- without a census -- WorldPop's own built-weighted median rate;
  • no building detected: WorldPop.

info reports the totals (WorldPop, census, estimate), the rates, and how many people the estimate adds where WorldPop was incongruent.

built_surface_population(built, worldpop, profile, census=None, census_col='population', min_ratio=0.25, k_nearest=5, out_tif=None)

See the module docstring. Returns (estimate array, info dict).

Parameters:

Name Type Description Default
built ndarray

Built floor area per pixel.

required
worldpop ndarray

WorldPop population per pixel (same grid).

required
profile dict

Raster profile of the grid.

required
census Optional[GeoDataFrame]

Optional census polygons with population.

None
census_col str

Census population column.

'population'
min_ratio float

WorldPop below this share of the built-surface estimate counts as missing.

0.25
k_nearest int

Census polygons used to calibrate a pixel outside the census.

5
out_tif Optional[str]

Optional output GeoTIFF.

None