Skip to content

Instantly share code, notes, and snippets.

@fabricebrito
Last active October 11, 2023 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabricebrito/4a0d2c86ba3cccf2b9d3300870338f39 to your computer and use it in GitHub Desktop.
Save fabricebrito/4a0d2c86ba3cccf2b9d3300870338f39 to your computer and use it in GitHub Desktop.

The /status returns additional links:

  • rel: results with the link to the /results of the OCG API Processes
  • rel: collection with the link to a STAC collection with an asset with the processing result catalog and all the information to consume it via the storage STAC extension
{

    "jobID": "2e2e794c-c85d-11ed-8512-4230b2a19c26",
    "started": "2023-03-22T02:56:45.066492Z",
    "finished": "2023-03-22T03:10:21.343129Z",
    "status": "successful",
    "message": "Done",
    "progress": "100",
    "links": [
        {
            "href": "http://ades.disasterscharter.org/charter/watchjob/processes/opt-calibration-0_10_3/jobs/2e2e794c-c85d-11ed-8512-4230b2a19c26",
            "rel": "self",
            "type": "application/json",
            "title": "get Status"
        },
        {
            "href": "http://ades.disasterscharter.org/charter/watchjob/processes/opt-calibration-0_10_3/jobs/2e2e794c-c85d-11ed-8512-4230b2a19c26/results",
            "rel": "results",
            "type": "application/json",
            "title": "get Result"
        },
        {
            "href": "http://ades.disasterscharter.org/charter/watchjob/processes/opt-calibration-0_10_3/jobs/2e2e794c-c85d-11ed-8512-4230b2a19c26/collection",
            "rel": "collection",
            "type": "application/json",
            "title": "get Result Collection"
        }
    ]

}

The /results then contains the STAC Catalog:

{
    "wf_outputs": {
        "id": "examples",
        "type": "Catalog",
        "title": "Example Catalog",
        "stac_version": "1.0.0",
        "description": "This catalog is a simple demonstration of an example catalog that is used to organize a hierarchy of collections and their items.",
        "links": [
            {
                "rel": "root",
                "href": "./catalog.json",
                "type": "application/json"
            },
            {
                "rel": "child",
                "href": "./extensions-collection/collection.json",
                "type": "application/json",
                "title": "Collection Demonstrating STAC Extensions"
            },
            {
                "rel": "child",
                "href": "./collection-only/collection.json",
                "type": "application/json",
                "title": "Collection with no items (standalone)"
            },
            {
                "rel": "child",
                "href": "./collection-only/collection-with-schemas.json",
                "type": "application/json",
                "title": "Collection with no items (standalone with JSON Schemas)"
            },
            {
                "rel": "item",
                "href": "./collectionless-item.json",
                "type": "application/json",
                "title": "Collection with no items (standalone)"
            },
            {
                "rel": "self",
                "href": "https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/catalog.json",
                "type": "application/json"
            }
        ]
    }
}

The ADES gets a new /collection route to return the STAC Collection that returns:

{
    "id": "548c86e3-3f4e-4a9f-9d2e-056e10825a13",
    "stac_version": "1.0.0",
    "stac_extensions": [
        "https://stac-extensions.github.io/storage/v1.0.0/schema.json"
    ],
    "links": [
        {
            "type": "application/json",
            "rel": "self",
            "title": "Collection for processing execution 548c86e3-3f4e-4a9f-9d2e-056e10825a13",
            "href": "https://ades-01.terradue.com/ogc-api/processes/v1/548c86e3-3f4e-4a9f-9d2e-056e10825a13"
        }
    ],
    "type": "Collection",
    "extent": {
        "spatial": {
            "bbox": [
                [
                    105.59583,
                    -6.7233333,
                    107.97361,
                    -5.2877778
                ]
            ]
        },
        "temporal": {
            "interval": [
                [
                    "2017-03-18T11:14:54Z",
                    "2018-12-26T11:15:08Z"
                ]
            ]
        }
    },
    "keywords": [],
    "assets": {
        "results": {
            "type": "application/application/geo+json",
            "roles": [],
            "title": "Results STAC Catalog for processing execution 548c86e3-3f4e-4a9f-9d2e-056e10825a13",
            "href": "s3://a-bucket/548c86e3-3f4e-4a9f-9d2e-056e10825a13/catalog.json",
            "storage:platform": "Terradue",
            "storage:region": "fr-par",
            "storage:requester_pays": false,
            "storage:tier": "Standard",
            "storage:endpoint": "https://s3.fr-par.scw.cloud"
        }
    },
    "license": "proprietary",
    "description": "Results for processing execution 548c86e3-3f4e-4a9f-9d2e-056e10825a13",
    "title": "Results for processing execution 548c86e3-3f4e-4a9f-9d2e-056e10825a13"
}
@gfenoy
Copy link

gfenoy commented Oct 11, 2023

Pour l'end-point suivant /jobs/<JobId>/collection, on obtiendrait

{ 
  "type": "FeatureCollection",
  "features": [
    { 
      "type": "Feature",
      "stac_version": "1.0.0",
      "id": "S2B_36RTT_20191205_0_L2A",
      "properties": {
        "created": "2020-09-05T06:12:56.899Z",
        "sentinel:product_id": "S2B_MSIL2A_20191205T083229_N0213_R021_T36RTT_20191205T111147",
        "sentinel:sequence": "0",
        "view:off_nadir": 0,
        "sentinel:valid_cloud_cover": true,
        "platform": "sentinel-2b",
        "sentinel:utm_zone": 36,
        "proj:epsg": 32636,
        "sentinel:grid_square": "TT",
        "datetime": "2019-12-05T08:42:04Z",
        "instruments": [
          "msi"
        ],
        "constellation": "sentinel-2",
        "eo:cloud_cover": 2.75,
        "gsd": 10,
        "sentinel:latitude_band": "R",
        "data_coverage": 67.28,
        "updated": "2020-09-05T06:12:56.899Z",
        "sentinel:data_coverage": 67.28
      },      
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [   
            [ 
              30.155974613579858,
              28.80949327971016
            ],
            [ 
              30.407037927198104,
              29.805008695373978
            ],
            [ 
              31.031551610920825,
              29.815791988006527
            ],
            [ 
              31.050481437029678,
              28.825387639743422
            ],
            [ 
              30.155974613579858,
              28.80949327971016
            ] 
          ]   
        ]     
      },      
      "links": [
        {     
          "rel": "root",
          "href": "s3://processingresults/snuggs-3903c34a-613c-11ee-95f7-0242ac110006/catalog.json",
          "type": "application/json"
        },    
        {     
          "rel": "self",
          "href": "s3://processingresults/snuggs-3903c34a-613c-11ee-95f7-0242ac110006/S2B_36RTT_20191205_0_L2A/S2B_36RTT_20191205_0_L2A.json",
          "type": "application/json"
        },    
        {                                                                                                                                                                                                       
          "rel": "parent",                                                                                                                                                                                      
          "href": "s3://processingresults/snuggs-3903c34a-613c-11ee-95f7-0242ac110006/catalog.json",                                                                                                            
          "type": "application/json"                                                                                                                                                                            
        }                                                                                                                                                                                                       
      ],                                                                                                                                                                                                        
      "assets": {                                                                                                                                                                                               
        "ndvi": {                                                                                                                                                                                               
          "href": "./ndvi.tif",                                                                                                                                                                                 
          "type": "image/tiff; application=geotiff; profile=cloud-optimized",                                                                                                                                   
          "s-expression": "(/ (- B05 B03) (+ B05 B03))",                                                                                                                                                        
          "file:size": 358224440,                                                                                                                                                                               
          "storage:platform": "Terradue",                                                                                                                                                                       
          "storage:requester_pays": false,
          "storage:tier": "Standard",
          "storage:region": "RegionOne",
          "storage:endpoint": "http://zoo-project-dru-minio.zp.svc.cluster.local:9000",
          "roles": [                                                                                                                                                                                            
            "data"                                                                                                                                                                                              
          ]                                                                                                                                                                                                     
        }                                                                                                                                                                                                       
      },                                                                                                                                                                                                        
      "bbox": [                                                                                                                                                                                                 
        30.155974613579858,                                                                                                                                                                                     
        28.80949327971016,                                                                                                                                                                                      
        31.050481437029678,                                                                                                                                                                                     
        29.815791988006527                                                                                                                                                                                      
      ],                                                                                                                                                                                                        
      "stac_extensions": [                                                                                                                                                                                      
        "https://stac-extensions.github.io/eo/v1.1.0/schema.json",                                                                                                                                              
        "https://stac-extensions.github.io/projection/v1.1.0/schema.json",                                                                                                                                      
        "https://stac-extensions.github.io/view/v1.0.0/schema.json"                                                                                                                                             
      ]                                                                                                                                                                                                         
    }                                                                                                                                                                                                           
  ]                                                                                                                                                                                                             
}                         

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