You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make classification layers (SCL, cloud masks) a full multiscale pyramid #274
The reflectance pyramid has 6 levels (r10m–r720m), a multiscales block, and sharded chunks. conditions/mask/l2a_classification has only r20m and r60m, no multiscales block, one chunk per array, and no flag attributes. Thus a client can read SCL, but it cannot tile it at low zoom levels, and it cannot find the meaning of each class.
Tasks:
Write r120m, r360m and r720m for l2a_classification (and the other classification masks). Use classification resampling (_coarsen_variable already supports it).
Write a multiscales block on l2a_classification. MultiscaleMeta(..., resampling_method="average") is hard-coded (s2_multiscale.py L864). Make the resampling method a parameter, and use nearest (or mode) for classification.
Use the same chunking and sharding as reflectance (spatial_chunk and sharding) for every raster group on x/y, not create_original_encoding.
Add CF flag_values and flag_meanings to scl, as quality/mask has flag_masks and flag_meanings.
Add classification:classes to the SCL asset in the STAC item.
Add a test that opens SCL at every level with titiler's GeoZarrReader.
Based on your task list i defined the code and implemented it, samples can be accessed here: aws s3 --profile eodc-cm --no-sign-request ls s3://continuous-integration/eopf-geozarr/branches/cpm-geozarr-main-feat-generic-conversion-s2-cld-snw-scl-MS/
Write r120m, r360m and r720m for l2a_classification (and the other classification masks). Use classification resampling (_coarsen_variable already supports it).
This should work, given the restructuring of the code into a generic_multiscales(...) function
Write a multiscales block on l2a_classification. MultiscaleMeta(..., resampling_method="average") is hard-coded (s2_multiscale.py L864). Make the resampling method a parameter, and use nearest (or mode) for classification.
MultiscaleMeta is not used, as the type validation of MultiscalesAttrs and LayoutObject should be enough. resampling_method is now extracted and used as a parameter.
Use the same chunking and sharding as reflectance (spatial_chunk and sharding) for every raster group on x/y, not create_original_encoding.
chunking and sharding is derived from create_uniform_encoding(...) which should satisfy this demand.
Add CF flag_values and flag_meanings to scl, as quality/mask has flag_masks and flag_meanings.
these are added, altough i noticed differences between l2a_classification/20m and l2a_classification/60m, which carry different metadata (seems to be passed down from cpm?)
here it might be relevant to note, that the l1c_classification variable b00 triggers the average handling for coarsening, as the current flagging system detects variables starting with b as reflectance. This should be adapted from my pint of view..
Add classification:classes to the SCL asset in the STAC item.
Should this not be done in eopf-stac? Seems more logical to me.
add a test that opens SCL at every level with titiler's GeoZarrReader.
This should be done outside of this repo right? Tests should be added, but only focus on eopf-geozarr logic
This is not a PR yet, just an aggregation of insigths to report progress and trigger discussions. The current development on the branch is also not complete yet, especially the tests need to be modified and adapted.
Activity
shollendEODC commentedon Oct 8, 2026
i adressed this topic in a pre-PR to investigate how easy/difficult it would be to add the associated logic. Its currently available here: https://github.com/shollendEODC/data-model/tree/integrate/cpm-geozarr-main-feat-generic-conversion-s2-cld-snw-scl-MS and is branched off of 039f38c
Based on your task list i defined the code and implemented it, samples can be accessed here:
aws s3 --profile eodc-cm --no-sign-request ls s3://continuous-integration/eopf-geozarr/branches/cpm-geozarr-main-feat-generic-conversion-s2-cld-snw-scl-MS/This should work, given the restructuring of the code into a
generic_multiscales(...)functionMultiscaleMeta is not used, as the type validation of
MultiscalesAttrsandLayoutObjectshould be enough.resampling_methodis now extracted and used as a parameter.chunking and sharding is derived from
create_uniform_encoding(...)which should satisfy this demand.these are added, altough i noticed differences between
l2a_classification/20mandl2a_classification/60m, which carry different metadata (seems to be passed down from cpm?)here it might be relevant to note, that the
l1c_classificationvariableb00triggers theaveragehandling for coarsening, as the current flagging system detects variables starting withbasreflectance. This should be adapted from my pint of view..Should this not be done in
eopf-stac? Seems more logical to me.This should be done outside of this repo right? Tests should be added, but only focus on
eopf-geozarrlogicThis is not a PR yet, just an aggregation of insigths to report progress and trigger discussions. The current development on the branch is also not complete yet, especially the tests need to be modified and adapted.
shollendEODC commentedon Oct 13, 2026
PR opened in #313