Skip to content

Additional results response type option: ItemCollection - #83

Merged
JanssenBrm merged 25 commits into
mainfrom
feature/result-change
Nov 19, 2026
Merged

JanssenBrm merged 25 commits into
mainfrom
feature/result-change

Conversation

@floeschau

Copy link
Copy Markdown
Contributor

This change adds a new option for the response of the /unit_jobs/{job_id}/results endpoint and the related platform implementations producing the response.

In addition to Collection, also ItemCollection is a possible response content.
The clients reveiving this response need to take this new type into account and obtain the assets and links from the items contained in features, rather than at the top (collection) level.

The OGC API implementation returns ItemCollection. Other implementations are unchanged (except for the extended method return type).

The schema changes as follows:

{
  "200": {
    "description": "Successful Response",
    "content": {
      "application/json": {
        "schema": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/Collection"
            },
            {
              "$ref": "#/components/schemas/ItemCollection"
            },
            {
              "type": "null"
            }
          ],
          "title": "Response Get Job Results Unit Jobs  Job Id  Results Get"
        }
      }
    }
  },
  ...
}

@floeschau

Copy link
Copy Markdown
Contributor Author

For reference, below is an example of the content returned by the Dispatch API results endpoint for an OGC API processing job:

{
  "bbox": [12.144773483653871, 41.99632936411604, 12.457746528641113, 42.1756330948263],
  "type": "FeatureCollection",
  "features": [
    {
      "bbox": [12.144773483653871, 41.99632936411604, 12.457746528641113, 42.1756330948263],
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [12.144773483653871, 41.99632936411604],
            [12.144773483653871, 42.1756330948263],
            [12.457746528641113, 42.1756330948263],
            [12.457746528641113, 41.99632936411604],
            [12.144773483653871, 41.99632936411604]
          ]
        ]
      },
      "properties": {
        "title": null,
        "description": null,
        "datetime": null,
        "created": null,
        "updated": null,
        "start_datetime": "2024-11-13T17:06:07Z",
        "end_datetime": "2024-11-13T17:06:32Z",
        "license": null,
        "providers": null,
        "platform": null,
        "instruments": null,
        "constellation": null,
        "mission": null,
        "gsd": null,
        "renders": {
          "ost_sar_rgb": {
            "assets": [
              "ost-ard-cog"
            ],
            "title": "OST SAR RGB composite",
            "rescale": [
              [-20, 0],
              [-26, -5],
              [2, 12]
            ],
            "nodata": 0,
            "resampling": "nearest",
            "bidx": [1, 2, 3]
          },
          "copol_mono": {
            "assets": [
              "ost-ard-cog"
            ],
            "title": "Co-polarisation backscatter (dB)",
            "rescale": [
              [-20, 0]
            ],
            "nodata": 0,
            "colormap_name": "grayscale",
            "resampling": "nearest",
            "bidx": [
              1
            ]
          },
          "crosspol_mono": {
            "assets": [
              "ost-ard-cog"
            ],
            "title": "Cross-polarisation backscatter (dB)",
            "rescale": [
              [-26, -5]
            ],
            "nodata": 0,
            "colormap_name": "grayscale",
            "resampling": "nearest",
            "bidx": [
              2
            ]
          },
          "ratio_mono": {
            "assets": [
              "ost-ard-cog"
            ],
            "title": "Co/Cross ratio",
            "rescale": [
              [2, 12]
            ],
            "nodata": 0,
            "colormap_name": "grayscale",
            "resampling": "nearest",
            "bidx": [
              3
            ]
          }
        },
        "processing:version": "2.2.1",
        "processing:datetime": "2026-10-05T16:20:57Z",
        "processing:facility": "gep",
        "auth:schemes": {
          "signed_url_auth": {
            "type": "signedUrl",
            "description": "Provides an authenticated download link for an asset URL in the Location HTTP header",
            "flows": {
              "authorizationCode": {
                "authorizationApi": "https://download.geohazards-tep.eu/44454d3235313539/\"44454d3235313539\"/collection/{collection_id}/items/{item_id}/assets/{asset_id}",
                "method": "GET",
                "parameters": {
                  "Authorization": {
                    "description": "Authentication credentials",
                    "in": "header",
                    "required": "true",
                    "schema": {
                      "examples": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiJhYmNkMTIzIiwiZXhwaXJ5IjoxNjQ2NjM1NjExMzAxfQ.3Thp81rDFrKXr3WrY1MyMnNK8kKoZBX9lg-JwFznR-M",
                      "type": "string"
                    }
                  },
                  "config_key": {
                    "in": "path",
                    "required": "true",
                    "schema": {
                      "type": "string",
                      "examples": "datalake"
                    }
                  },
                  "collection_id": {
                    "in": "path",
                    "required": "true",
                    "schema": {
                      "type": "string",
                      "examples": "sentinel-2"
                    }
                  },
                  "item_id": {
                    "in": "path",
                    "required": "true",
                    "schema": {
                      "type": "string",
                      "examples": "S2B_MSIL2A_20240910T094029_N0511_R036_T33TWF_20240910T130556"
                    }
                  },
                  "asset_id": {
                    "in": "path",
                    "required": "true",
                    "schema": {
                      "type": "string",
                      "examples": "red"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "id": "S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG",
      "stac_version": "1.1.0",
      "assets": {
        "ost-ard-cog": {
          "href": "https://s3.fr-par.scw.cloud/argo-wf-gep-44454d3235313539/44454d3235313539/opensartoolkit-v2-2-1/dsb8v/zwdj6w/opensartoolkit-v2-2-1-dsb8v-zwdj6w/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/ost-ard-cog.tif?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=SCWDH95EQZ9QY74C6R3K%2F20261030%2Ffr-par%2Fs3%2Faws4_request&X-Amz-Date=20261030T103943Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=51bf6c839361a1a2acead35c0c2b6bcf11b061985fcc25a74f4437fb0fed1e27",
          "type": "image/tiff; application=geotiff; profile=cloud-optimized",
          "title": "OST-processed ARD COG",
          "description": "OST ARD raster with 3 bands - (1) co-pol backscatter (dB), (2) cross-pol backscatter (dB), (3) derived co/cross ratio",
          "roles": [
            "data",
            "visual"
          ],
          "file:size": 25121991,
          "auth:refs": [
            "signed_url_auth"
          ],
          "alternate": {
            "https": {
              "href": "https://download.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w/items/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/assets/ost-ard-cog",
              "alternate:name": "HTTPS"
            }
          }
        }
      },
      "links": [
        {
          "href": "https://processing.geohazards-tep.eu/44454d3235313539/jobs/opensartoolkit-v2-2-1-dsb8v",
          "rel": "processing-execution",
          "type": "application/json",
          "title": "OGC API Processes job id: opensartoolkit-v2-2-1-dsb8v"
        },
        {
          "href": "https://view.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w/items/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?&assets=ost-ard-cog&rescale=-20,0&rescale=-26,-5&rescale=2,12&nodata=0&resampling=nearest&bidx=1&bidx=2&bidx=3",
          "rel": "xyz",
          "type": "image/png",
          "title": "OST SAR RGB composite visualized through a XYZ",
          "render": "ost_sar_rgb"
        },
        {
          "href": "https://view.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w/items/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?&assets=ost-ard-cog&rescale=-20,0&nodata=0&colormap_name=grayscale&resampling=nearest&bidx=1",
          "rel": "xyz",
          "type": "image/png",
          "title": "Co-polarisation backscatter (dB) visualized through a XYZ",
          "render": "copol_mono"
        },
        {
          "href": "https://view.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w/items/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?&assets=ost-ard-cog&rescale=-26,-5&nodata=0&colormap_name=grayscale&resampling=nearest&bidx=2",
          "rel": "xyz",
          "type": "image/png",
          "title": "Cross-polarisation backscatter (dB) visualized through a XYZ",
          "render": "crosspol_mono"
        },
        {
          "href": "https://view.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w/items/S1A_IW_GRDH_1SDV_20241113T170607_20241113T170632_056539_06EEA8_B145-COG/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?&assets=ost-ard-cog&rescale=2,12&nodata=0&colormap_name=grayscale&resampling=nearest&bidx=3",
          "rel": "xyz",
          "type": "image/png",
          "title": "Co/Cross ratio visualized through a XYZ",
          "render": "ratio_mono"
        },
        {
          "href": "https://results.geohazards-tep.eu/44454d3235313539/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w",
          "rel": "collection",
          "type": "application/json",
          "title": "opensartoolkit v2-2-1 processing results (opensartoolkit-v2-2-1-dsb8v)",
          "alternate": {
            "internal": {
              "href": "http://stac-fastapi-catalog-44454d3235313539.44454d3235313539.svc.cluster.local/collections/opensartoolkit-v2-2-1-dsb8v-zwdj6w"
            },
            "s3": {
              "href": "s3://argo-wf-gep-44454d3235313539/44454d3235313539/opensartoolkit-v2-2-1/dsb8v/zwdj6w/opensartoolkit-v2-2-1-dsb8v-zwdj6w/collection.json"
            }
          }
        }
      ],
      "stac_extensions": [
        "https://stac-extensions.github.io/raster/v1.1.0/schema.json",
        "https://stac-extensions.github.io/render/v2.0.0/schema.json",
        "https://stac-extensions.github.io/file/v2.1.0/schema.json",
        "https://stac-extensions.github.io/processing/v1.2.0/schema.json",
        "https://stac-extensions.github.io/authentication/v1.0.0/schema.json",
        "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json",
        "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
      ],
      "collection": "opensartoolkit-v2-2-1-dsb8v-zwdj6w"
    }
  ],
  "links": []
}

@JanssenBrm
JanssenBrm self-requested a review November 17, 2026 11:53
@floeschau

Copy link
Copy Markdown
Contributor Author

Hello @JanssenBrm, There is an issue with the change you made in this commit. The asset is not a dict, but a Pydantic object. This needs to be reverted.

@floeschau

Copy link
Copy Markdown
Contributor Author

@JanssenBrm, I pushed a new commit reverting a part of your change so that the asset is correctly used as a Pydantic Asset rather than a dictionary.

@JanssenBrm
JanssenBrm merged commit 9bd9cef into main Nov 19, 2026
1 check passed
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.

2 participants