Skip to content

Pre-compute STAC Item Aggregations for Timeline UI #96

@A-Behairi

Description

@A-Behairi

Background & Context

See EOPF-Explorer/landing-page#61

To resolve this, we need to pre-compute item counts at the end of the ingestion process and output them as static JSON files for the application to fetch.

Key Tasks

The pipeline needs to ideally generate two JSON Objects per STAC Collection:

  • Daily aggregation
  • Monthly aggregation (optional)
    • This will help the user get a faster initial load in case of bigger collections

I suggest the structure of the file to mimic a datetime range Aggregation Collection response based on the Aggregation Extension to maintain STAC compliance, for e.g:

 {   
        "type": "AggregationCollection",
        "aggregations": [
            {
                "key": "datetime_daily",
                "buckets": [
                    { 
                        "key": "2026-01-01T00:00:00.000Z",
                        "value" : "8644819",
                    },
                    {
                        "key": "2026-01-02T00:00:00.000Z",
                        "value" : "5644819",
                    },
                    {
                        "key": "2026-01-03T00:00:00.000Z",
                        "value" : "7644819"
                    }
                ],
                "interval": "daily",
            }
        ]
    }

STAC Integration

I am unsure about what the best solution for this might be, considering STAC conformance and the effort required, here are a couple of suggestions that I can think of:

  1. /aggregate Endpoint
    To have it under /aggregate with collection and data_type parameters, for example https://api.explorer.eopf.copernicus.com/stac/aggregations?collection="sentinel-2-l2a"&data_type="interval_daily"

  2. Aggregation Links
    Have links with rel: "aggregate" and indicate the interval using an aggregation: prefixed property for e.g.:

{
      "rel": "aggregate",
      "href": "https://example.com/timeline-daily.json",
      "type": "application/json",
      "title": "Daily Item Aggregation",
      "aggregation:interval": "daily" 
}

or with the interval indicated in the rel property

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions