Skip to content

Commit 8974d65

Browse files
committed
Fixup Issue #298 add "common_name" to assets band metadata too
"NDVI" is not a valid common_name apparently which started triggering STAC validation errors. Changed a dummy result to B04/blue instead.
1 parent fb7285d commit 8974d65

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

openeo_driver/dummy/dummy_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def get_result_assets(self, job_id: str, user_id: str) -> Dict[str, dict]:
879879
"href": f"{self._output_root()}/{job_id}/subfolder/output.tiff",
880880
"type": "image/tiff; application=geotiff",
881881
"roles": ["data"],
882-
"bands": [Band(name="NDVI", common_name="NDVI", wavelength_um=1.23)],
882+
"bands": [Band(name="NDVI", wavelength_um=1.23)],
883883
"nodata": 123,
884884
"instruments": "MSI",
885885
"bbox": [0.0, 50.0, 5.0, 55.0],
@@ -896,7 +896,7 @@ def get_result_assets(self, job_id: str, user_id: str) -> Dict[str, dict]:
896896
"href": f"{self._output_root()}/{job_id}/output.tiff",
897897
"type": "image/tiff; application=geotiff",
898898
"roles": ["data"],
899-
"bands": [Band(name="NDVI", common_name="NDVI", wavelength_um=1.23)],
899+
"bands": [Band(name="B02", common_name="blue", wavelength_um=0.665)],
900900
"nodata": 123,
901901
"instruments": "MSI",
902902
"bbox": [0.0, 50.0, 5.0, 55.0],

tests/test_views.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,8 +1812,8 @@ def test_get_job_results_100(self, api100):
18121812
"title": "output.tiff",
18131813
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/output.tiff",
18141814
"type": "image/tiff; application=geotiff",
1815-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
1816-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
1815+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
1816+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
18171817
},
18181818
"output.nc": {
18191819
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/output.nc",
@@ -1885,8 +1885,8 @@ def test_get_job_results_100(self, api100):
18851885
"type": "image/tiff; application=geotiff",
18861886
"proj:epsg": 4326,
18871887
"proj:shape": [300, 600],
1888-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
1889-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
1888+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
1889+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
18901890
},
18911891
"output.nc": {
18921892
"href": "http://oeo.net/openeo/1.0.0/jobs/53c71345-09b4-46b4-b6b0-03fd6fe1f199/results/assets/output.nc",
@@ -1984,8 +1984,8 @@ def test_get_job_results_110(self, api110):
19841984
"title": "output.tiff",
19851985
"href": "http://oeo.net/openeo/1.1.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/output.tiff",
19861986
"type": "image/tiff; application=geotiff",
1987-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
1988-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
1987+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
1988+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
19891989
},
19901990
"output.nc": {
19911991
"href": "http://oeo.net/openeo/1.1.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/output.nc",
@@ -2069,8 +2069,8 @@ def test_get_job_results_110(self, api110):
20692069
"type": "image/tiff; application=geotiff",
20702070
"proj:epsg": 4326,
20712071
"proj:shape": [300, 600],
2072-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
2073-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
2072+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
2073+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
20742074
},
20752075
"output.nc": {
20762076
"href": "http://oeo.net/openeo/1.1.0/jobs/53c71345-09b4-46b4-b6b0-03fd6fe1f199/results/assets/output.nc",
@@ -2257,8 +2257,8 @@ def test_get_job_results_signed_100(self, api100, flask_app, backend_config_over
22572257
"title": "output.tiff",
22582258
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/50afb0cad129e61d415278c4ffcd8a83/output.tiff",
22592259
"type": "image/tiff; application=geotiff",
2260-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
2261-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
2260+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
2261+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
22622262
},
22632263
"output.nc": {
22642264
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/e28f17365e698783574dd313de0d64cd/output.nc",
@@ -2399,8 +2399,8 @@ def test_get_job_results_signed_110(self, api110, flask_app, backend_config_over
23992399
"title": "output.tiff",
24002400
"href": "http://oeo.net/openeo/1.1.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/50afb0cad129e61d415278c4ffcd8a83/output.tiff",
24012401
"type": "image/tiff; application=geotiff",
2402-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
2403-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
2402+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
2403+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
24042404
},
24052405
"output.nc": {
24062406
"href": "http://oeo.net/openeo/1.1.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/e28f17365e698783574dd313de0d64cd/output.nc",
@@ -2543,8 +2543,8 @@ def test_get_job_results_signed_with_expiration_100(self, api100, flask_app, bac
25432543
"title": "output.tiff",
25442544
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/fd0ca65e29c6d223da05b2e73a875683/output.tiff?expires=2234",
25452545
"type": "image/tiff; application=geotiff",
2546-
"eo:bands": [{"name": "NDVI", "center_wavelength": 1.23}],
2547-
"bands": [{"name": "NDVI", "eo:center_wavelength": 1.23}],
2546+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
2547+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
25482548
},
25492549
"output.nc": {
25502550
"href": "http://oeo.net/openeo/1.0.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA==/3ed7b944c4f9cc88d2c3ef7534a27596/output.nc?expires=2234",
@@ -2731,8 +2731,8 @@ def test_get_job_results_signed_with_expiration_110(self, api110, flask_app, bac
27312731
"type": "image/tiff; application=geotiff",
27322732
"proj:epsg": 4326,
27332733
"proj:shape": [300, 600],
2734-
"eo:bands": [{"center_wavelength": 1.23, "name": "NDVI"}],
2735-
"bands": [{"eo:center_wavelength": 1.23, "name": "NDVI"}],
2734+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
2735+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
27362736
"roles": ["data"],
27372737
},
27382738
"output.nc": {
@@ -3115,8 +3115,8 @@ def test_get_job_result_item(self, flask_app, api110, backend_config_overrides):
31153115
"type": "image/tiff; application=geotiff",
31163116
"proj:epsg": 4326,
31173117
"proj:shape": [300, 600],
3118-
"eo:bands": [{"center_wavelength": 1.23, "name": "NDVI"}],
3119-
"bands": [{"eo:center_wavelength": 1.23, "name": "NDVI"}],
3118+
"eo:bands": [{"name": "B02", "common_name": "blue", "center_wavelength": 0.665}],
3119+
"bands": [{"name": "B02", "eo:common_name": "blue", "eo:center_wavelength": 0.665}],
31203120
"roles": ["data"],
31213121
}
31223122
},

0 commit comments

Comments
 (0)