Skip to content

Population

Access Data

Have more questions? Contact Vivek Sakhrani


Overview

The population estimates contained in this dataset are aggregates from three highly regarded and trusted sources: the Global Human Settlement Layer, the Gridded Population of World Version 4, and WorldPop.

First a simple growth is calculated using WorldPop estimates for the prior five years then the growth rate is applied to the population counts for the other two data sources in order to generate counts for these sources. The sources are then averaged to obtain the estimates present in this dataset.

All versions include both population-count and population-density datasets.

Methods

For details on methods, input data sources, validation, and background citations, please consult:
https://docs.atlasai.co/population/

Version information

This data is available in multiple versions in raster format and is updated annually for several geographic regions.

Version 2022

Data type: Float32
No-data value: 3.40282e+38
Min/max values: 1 (min), 122768.51 (max)
Time horizon: 2003–2021
Spatial representation: Raster grid
Spatial resolution: 1km x 1km
Extent: 43 countries in Sub-Saharan Africa plus six countries in South Asia (Angola, Burundi, Benin, Burkina Faso, Botswana, Central African Republic, Côte d'Ivoire, Cameroon, Democratic Republic of the Congo, Republic of the Congo, Eritrea, Ethiopia, Gabon, Ghana, Guinea, The Gambia, Guinea-Bissau, Equatorial Guinea, Kenya, Liberia, Lesotho, Madagascar, Mali, Mozambique, Mauritania, Malawi, Namibia, Niger, Nigeria, Rwanda, Senegal, Sierra Leone, Somalia, South Sudan, Sudan, Eswatini, Chad, Togo, Tanzania, Uganda, South Africa, Zambia, Zimbabwe)
National boundaries source: geoBoundaries

Version 2022 (beta)

Data type: Float32
No-data value: 3.40282e+38
Min/max values: 1.0000001 (min), 160587.4 (max)
Time horizon: 2012–2021
Spatial representation: Raster grid
Spatial resolution: 1km x 1km
Extent: Six countries in South Asia (Bangladesh, Bhutan, India, Nepal, Pakistan, Sri Lanka)
National boundaries source: geoBoundaries and Natural Earth (India POV)

Version 2021

Data type: Float32
No-data value: -9999
Min/max values: 0 (min), 345338.47 (max)
Time horizon: 2003–2020
Spatial representation: Raster grid
Spatial resolution: 2km x 2km
Extent: Sub-Saharan Africa

Version compatibility

Version 2022 and Version 2022 (beta) have a higher spatial resolution (1km x 1km) than Version 2021 (2km x 2km). Version 2022 and Version 2022 (beta) are therefore incompatible with Version 2021.

Code samples

Below are two code samples for, first, generating color maps to display Population data in Python and, second, generating color maps to display Population-Density data in Python.

Generate Population color maps

import numpy as np
from matplotlib import colors


def hex2color_map(name, hex_list):
    color_tuples = list(map(_parse_hex, hex_list))
    color_tuples_normalized = [
        (e[0] / 255.0, e[1] / 255.0, e[2] / 255.0, 255.0) for e in color_tuples
    ]
    cmap = normalized_color_tuples2cmap(color_tuples_normalized)
    save_cmap(name, cmap)


def save_cmap(name, cmap):
    cmap_vals = cmap(np.linspace(0, 1, 255))
    cmap_uint8 = (cmap_vals * 255).astype("uint8")

    np.save(name + "_rgba.npy", cmap_uint8)


def normalized_color_tuples2cmap(color_tuples_normalized, interpolate=True):
    if not interpolate:
        # No color interpolation:
        return colors.ListedColormap(color_tuples_normalized, "woooooooooooo")

    ### With color interpolation:
    nc = len(color_tuples_normalized)
    c = np.zeros((3, nc, 3))
    rgb = ["red", "green", "blue"]
    for idx, e in enumerate(color_tuples_normalized):
        for ii in range(3):
            c[ii, idx, :] = [float(idx) / float(nc - 1), e[ii], e[ii]]

    cdict = dict(zip(rgb, c))
    cmap = colors.LinearSegmentedColormap("woooooooooooo", cdict)
    return cmap


def _parse_hex(color_code):
    return (
        int(color_code[1:3], 16),
        int(color_code[3:5], 16),
        int(color_code[5:7], 16),
    )


hex2color_map(
    "AtlasAI_Population",
    [
        "#ffffd9",
        "#edf8b1",
        "#c7e9b4",
        "#7fcdbb",
        "#41b6c4",
        "#1d91c0",
        "#225ea8",
        "#253494",
        "#081d58",
    ],
)

Generate Population-Density color maps

import numpy as np
from matplotlib import colors


def hex2color_map(name, hex_list):
    color_tuples = list(map(_parse_hex, hex_list))
    color_tuples_normalized = [
        (e[0] / 255.0, e[1] / 255.0, e[2] / 255.0, 255.0) for e in color_tuples
    ]
    cmap = normalized_color_tuples2cmap(color_tuples_normalized)
    save_cmap(name, cmap)


def save_cmap(name, cmap):
    cmap_vals = cmap(np.linspace(0, 1, 255))
    cmap_uint8 = (cmap_vals * 255).astype("uint8")

    np.save(name + "_rgba.npy", cmap_uint8)


def normalized_color_tuples2cmap(color_tuples_normalized, interpolate=True):
    if not interpolate:
        # No color interpolation:
        return colors.ListedColormap(color_tuples_normalized, "woooooooooooo")

    ### With color interpolation:
    nc = len(color_tuples_normalized)
    c = np.zeros((3, nc, 3))
    rgb = ["red", "green", "blue"]
    for idx, e in enumerate(color_tuples_normalized):
        for ii in range(3):
            c[ii, idx, :] = [float(idx) / float(nc - 1), e[ii], e[ii]]

    cdict = dict(zip(rgb, c))
    cmap = colors.LinearSegmentedColormap("woooooooooooo", cdict)
    return cmap


def _parse_hex(color_code):
    return (
        int(color_code[1:3], 16),
        int(color_code[3:5], 16),
        int(color_code[5:7], 16),
    )


hex2color_map(
    "AtlasAI_Population_Density",
    [
        "#ffffcc",
        "#ffeda0",
        "#fed976",
        "#feb24c",
        "#fd8d3c",
        "#fc4e2a",
        "#e31a1c",
        "#bd0026",
        "#800026",
    ],
)