Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new Earth Engine format and functions (DHIS2-16097) #548

Merged
merged 58 commits into from
Jul 31, 2024

Conversation

turban
Copy link
Collaborator

@turban turban commented Aug 29, 2023

Fixes: https://dhis2.atlassian.net/browse/DHIS2-16097

Depends on dhis2/maps-app#3158 if you want to test this PR in DHIS2 Maps.

BREAKING CHANGE
Requires some changes in the options passed to the EE layer if we want to use the latest version of @dhis2/maps-gl in released versions of DHIS2 Maps. The changes required are shown in this PR: https://github.com/dhis2/maps-app/pull/3067/files

Main changes:

  • New period reducer (used for temperature and precipitation layers)
  • "params" option is renamed to "style" (more descriptive)
  • "style" can be an object or an array of classification (previously we passed in a legend)
  • Support custom feature style (used for buildings layer)
  • Support filtering for feature layers (e.g. "buldings larger than 50 m2)
  • Support masking out below min values using different mask operators (e.g. "gt" and "gte")
  • Mask out clouds from satellite images
  • New useCentroid option to only include grid cells where the centroid is within the feature (used for population layers)
  • Allow value precision (number of decimals) to be set
  • Upgrade to latest version for Earth Engine JavaScript API (custom build for web worker usage)
  • Some code refactoring

Hard to add unit tests as most of the code is running in the GEE cloud. Easier to add tests that the various layers load in DHIS2 Maps.

Currently, we support 3 common GEE formats, "Image", "ImageCollection" and "FeatureCollection" - an "Unknown format" error will be returned if another format is used (but this should not happen when we control the EE layer configs):

Screenshot 2023-11-20 at 15 20 43

@turban turban marked this pull request as draft August 29, 2023 10:40
@turban turban changed the title BREAKING CHANGE: new Earth Engine format feat: new Earth Engine format Sep 7, 2023
@turban turban changed the title feat: new Earth Engine format BREAKING CHANGE: new Earth Engine format and functions (DHIS2-16097) Nov 20, 2023
Copy link
Collaborator

@BRaimbault BRaimbault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense to me.
There is quite a bit to check though, on a codebase I was not familiar with in the first place.

  1. I propose to go through extensive testing once we get all the pieces together, including adding other GEE layers in maps-app.
  2. It seems making it work with maps-app-v39 should not be too complicated but it has to be included in the testing.

* fix: only use mask for ee tiles
* feat: new unmask aggregation param
* Allow mask value to be passed in
@BRaimbault BRaimbault merged commit c97b9c6 into master Jul 31, 2024
3 checks passed
@BRaimbault BRaimbault deleted the feat/custom-ee-layers branch July 31, 2024 08:20
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants