Skip to content

Raster data registry, cached reading, custom api endpoints#3

Merged
karimbahgat merged 29 commits intomainfrom
data-registry-and-caching
Feb 26, 2026
Merged

Raster data registry, cached reading, custom api endpoints#3
karimbahgat merged 29 commits intomainfrom
data-registry-and-caching

Conversation

@karimbahgat
Copy link
Collaborator

@karimbahgat karimbahgat commented Feb 24, 2026

Self contained datasets module with its own route, independent of other parts of the repo.

I dont want to optimize this code since we dont know what will or wont be used, so I tried to exclude from ruff and mypy. Still getting errors, but think we should merge and fix it later.

The core is a dataset registry/cache system based purely on yaml files, no source-specific code. Everything is generic.

To download data for a dataset, trigger /datasets/ID/build_cache.

To optimize downloaded data into efficient zarr store, trigger datasets/ID/optimize_cache.

After that you can calculate dataset stats for DHIS2 org units via datasets/ID/PERIOD_TYPE/orgunits. To render a quick map image of what it would look like, add /preview at the end.

To dynamically create time aggregated raster dataset you can use datasets/ID/PERIOD_TYPE/raster. To render a quick map image of what it would look like, add /preview at the end.

The /tiles endpoint is just a dummy and does not work, but should be possible to just redirect to TiTiler endpoint pointing to dynamically generated file.

image

Karim Bahgat added 22 commits February 23, 2026 13:02
…al code so we always work with an xarray dataset, dask compute after time aggregation to avoid very slow dask graphs later
…s zarr file if it exists which is much faster
@karimbahgat karimbahgat changed the title Data registry and caching Raster data registry, caching, cache reads, custom api endpoints for aggregate and raster download Feb 25, 2026
@karimbahgat karimbahgat changed the title Raster data registry, caching, cache reads, custom api endpoints for aggregate and raster download Raster data registry, caching, cache reads, custom api endpoints Feb 25, 2026
@karimbahgat karimbahgat changed the title Raster data registry, caching, cache reads, custom api endpoints Raster data registry, cached reading, custom api endpoints Feb 25, 2026
@karimbahgat karimbahgat marked this pull request as ready for review February 26, 2026 14:39
@karimbahgat karimbahgat requested a review from turban February 26, 2026 14:56
@karimbahgat karimbahgat merged commit c24cae7 into main Feb 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant