Skip to content

Commit

Permalink
Merge pull request #1029 from xcube-dev/konstntokas-1020-xcube_server…
Browse files Browse the repository at this point in the history
…_add_store_parameters_to_stac_asset

Add data store parameters and data ID to the assets in the STAC published by xcube server
  • Loading branch information
forman authored Jul 10, 2024
2 parents da0df9e + be95304 commit 7fee68e
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
* The `xcube.core.store.DataDescriptor` class now supports specifying time ranges
using both `datetime.date` and `datetime.datetime` objects. Previously,
only `datetime.date` objects were supported.
* The xcube server STAC API has been adjusted so that the data store
parameters and data ID, which are needed to open the data referred to by a STAC item,
are now included with the item's `analytic` asset.
Furthermore, a second assert called `analytic_multires` will be published
referring to the multi-resolution data format levels (#1020).

## Changes in 1.6.0

Expand Down
78 changes: 77 additions & 1 deletion test/webapi/ows/stac/demo-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/datasets/demo.zarr",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "datasets",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo.zarr"
},
"xcube:analytic": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
Expand Down Expand Up @@ -50,6 +63,69 @@
}
}
},
"analytic_multires": {
"title": "demo multi-resolution data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "pyramids",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo.levels"
},
"xcube:analytic_multires": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels/0.zarr/c2rcc_flags"
},
"conc_chl": {
"title": "conc_chl data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels/0.zarr/conc_chl"
},
"conc_tsm": {
"title": "conc_tsm data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels/0.zarr/conc_tsm"
},
"kd489": {
"title": "kd489 data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels/0.zarr/kd489"
},
"quality_flags": {
"title": "quality_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo.levels/0.zarr/quality_flags"
}
}
},
"visual": {
"title": "demo visualisation",
"roles": [
Expand Down Expand Up @@ -807,4 +883,4 @@
"datetime": null,
"start_datetime": "2017-01-16T10:09:21Z",
"end_datetime": "2017-01-30T10:46:33Z"
}
}
118 changes: 117 additions & 1 deletion test/webapi/ows/stac/stac-datacubes-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,19 @@
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/datasets/demo-1w.zarr",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "datasets",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo-1w.zarr"
},
"xcube:analytic": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
Expand Down Expand Up @@ -1053,6 +1066,109 @@
}
}
},
"analytic_multires": {
"title": "demo-1w multi-resolution data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "pyramids",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo-1w.levels"
},
"xcube:analytic_multires": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/c2rcc_flags"
},
"conc_chl": {
"title": "conc_chl data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_chl"
},
"conc_tsm": {
"title": "conc_tsm data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_tsm"
},
"kd489": {
"title": "kd489 data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/kd489"
},
"quality_flags": {
"title": "quality_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/quality_flags"
},
"c2rcc_flags_stdev": {
"title": "c2rcc_flags_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/c2rcc_flags_stdev"
},
"conc_chl_stdev": {
"title": "conc_chl_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_chl_stdev"
},
"conc_tsm_stdev": {
"title": "conc_tsm_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_tsm_stdev"
},
"kd489_stdev": {
"title": "kd489_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/kd489_stdev"
},
"quality_flags_stdev": {
"title": "quality_flags_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/quality_flags_stdev"
}
}
},
"visual": {
"title": "demo-1w visualisation",
"roles": [
Expand Down Expand Up @@ -1152,4 +1268,4 @@
"href": "http://localhost:8080/tiles/demo-1w/c2rcc_flags/0/0/0?time=2017-01-22T00:00:00.000000000"
}
}
}
}
118 changes: 117 additions & 1 deletion test/webapi/ows/stac/stac-single-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,19 @@
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/datasets/demo-1w.zarr",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "datasets",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo-1w.zarr"
},
"xcube:analytic": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
Expand Down Expand Up @@ -1053,6 +1066,109 @@
}
}
},
"analytic_multires": {
"title": "demo-1w multi-resolution data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels",
"xcube:data_store_id": "s3",
"xcube:data_store_params": {
"root": "pyramids",
"storage_options": {
"anon": true,
"client_kwargs": {
"endpoint_url": "http://localhost:8080/s3"
}
}
},
"xcube:open_data_params": {
"data_id": "demo-1w.levels"
},
"xcube:analytic_multires": {
"c2rcc_flags": {
"title": "c2rcc_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/c2rcc_flags"
},
"conc_chl": {
"title": "conc_chl data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_chl"
},
"conc_tsm": {
"title": "conc_tsm data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_tsm"
},
"kd489": {
"title": "kd489 data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/kd489"
},
"quality_flags": {
"title": "quality_flags data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/quality_flags"
},
"c2rcc_flags_stdev": {
"title": "c2rcc_flags_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/c2rcc_flags_stdev"
},
"conc_chl_stdev": {
"title": "conc_chl_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_chl_stdev"
},
"conc_tsm_stdev": {
"title": "conc_tsm_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/conc_tsm_stdev"
},
"kd489_stdev": {
"title": "kd489_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/kd489_stdev"
},
"quality_flags_stdev": {
"title": "quality_flags_stdev data access",
"roles": [
"data"
],
"type": "application/zarr",
"href": "http://localhost:8080/s3/pyramids/demo-1w.levels/0.zarr/quality_flags_stdev"
}
}
},
"visual": {
"title": "demo-1w visualisation",
"roles": [
Expand Down Expand Up @@ -1152,4 +1268,4 @@
"href": "http://localhost:8080/tiles/demo-1w/c2rcc_flags/0/0/0?time=2017-01-22T00:00:00.000000000"
}
}
}
}
Loading

0 comments on commit 7fee68e

Please sign in to comment.