Skip to content

mapaction/population-tool

Repository files navigation

Population Tool

Open in Streamlit license Code style: black Imports: isort

This repository contains a Streamlit app that enables users to extract population information (aggregated and disaggregated by age and gender) for specific areas defined by shapefiles.

The population information is retrieved from WorldPop, an open-access data repository that focuses on generating and providing detailed population data for different regions and countries around the world. The aim of WorldPop is to improve our understanding of human population dynamics and their interactions with social, economic, and environmental factors. The organization utilizes various sources of data, including census records, satellite imagery, household surveys, and other demographic information, to estimate population distribution and demographic characteristics at high spatial resolutions. WorldPop employs advanced spatial modeling techniques and statistical methods to generate population estimates at fine-scale resolutions (100 meters in this case).

The accuracy of the results provided by the tool may vary depending on the region due to limitations of the WorldPop's population data, in terms of spatial and temporal resolution, as well as inherent uncertainty resulting from modeling and statistical techniques used for estimation.

Usage

Requirements

The Python version currently used is 3.9. Please install all packages from requirements.txt:

pip install -r requirements.txt

Google Earth Engine authentication

Sign up for a Google Earth Engine account, if you don't already have one. Open a terminal window, type python and then paste the following code:

import ee
ee.Authenticate()

Log in to your Google account to obtain the authorization code and paste it back into the terminal. Once you press "Enter", an authorization token will be saved to your computer under the following file path (depending on your operating system):

  • Windows: C:\\Users\\USERNAME\\.config\\earthengine\\credentials
  • Linux: /home/USERNAME/.config/earthengine/credentials
  • MacOS: /Users/USERNAME/.config/earthengine/credentials

The credentials will be used when initialising Google Earth Engine in the app.

Run the app

Open a terminal and run

streamlit run app/Home.py

A new browser window will open and you can start using the tool.

Contributing

Pre-commit

All code is formatted according to black and flake8 guidelines. The repo is set-up to use pre-commit. Please run pre-commit install the first time you are editing. Thereafter all commits will be checked against black and flake8 guidelines.

To check if your changes pass pre-commit without committing, run:

pre-commit run --all-files

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published