Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

GOSTrocks Primer

GOSTrocks is an internal sandbox repository that contains commonly used geospatial functions and operations. This notebooks demonstrates the usage of selected functions.

The repository also contains customized code to process specific datasets (GHSL, OpenStreetMap, Nighttime Lights, Fathom). This code is in constant development as project requirements evolve over time.

Open in Colab

Installation

From PyPI

pip install GOSTrocks

From Source

git clone https://github.com/worldbank/GOSTrocks.git
cd GOSTrocks
pip install .

Import Functions

GOSTrocks is broken down into modules of functions that share common elements.

Raster Example

One of the most recurring workflows is to clip and combine raster data from different sources.

Here, we work with population data from WorldPop, and a friction surface from the Malaria Atlas Project, using Ghana as our area of interest.

They are both global datasets with ~1km resolution, so they both need to be clipped and standardized for analysis.

We will use administrative boundaries from the GeoBoundaries API.

Get Boundaries

Download Population Data

Clip Global Friction Surface

Standardize Rasters

Align the population raster to the friction surface, ensuring that they have the same extent and resolution.

Original population raster metadata:

New population metadata aligned with travel surface: