Skip to content

Commit ae4738a

Browse files
jdriespvbouwel
authored andcommitted
Open-EO#334 compute geometry bbox in target crs if possible
1 parent f0c60af commit ae4738a

4 files changed

Lines changed: 15 additions & 20 deletions

File tree

tests/data/pg/1.0/aggregate_feature_collection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"loadco1": {
33
"process_id": "load_collection",
44
"arguments": {
5-
"id": "S2_FOOBAR",
5+
"id": "ESA_WORLDCOVER_10M_2020_V1",
66
"spatial_extent": {
77
"west": 5,
88
"east": 6,

tests/data/pg/1.0/aggregate_spatial.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"collection": {
33
"process_id": "load_collection",
44
"arguments": {
5-
"id": "S2_FAPAR_CLOUDCOVER"
5+
"id": "ESA_WORLDCOVER_10M_2020_V1"
66
}
77
},
88
"aggregate_spatial": {

tests/data/pg/1.0/mask.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"collection": {
33
"process_id": "load_collection",
44
"arguments": {
5-
"id": "S2_FAPAR_CLOUDCOVER"
5+
"id": "ESA_WORLDCOVER_10M_2020_V1"
66
}
77
},
88
"mask_collection": {

tests/test_views_execute.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def test_execute_mask(api):
582582
assert params["spatial_extent"] == expected_spatial_extent
583583
assert params["aggregate_spatial_geometries"] == expected_geometry
584584

585-
params = dummy_backend.last_load_collection_call('S2_FAPAR_CLOUDCOVER')
585+
params = dummy_backend.last_load_collection_call('ESA_WORLDCOVER_10M_2020_V1')
586586
assert params["spatial_extent"] == expected_spatial_extent
587587

588588

@@ -622,7 +622,7 @@ def test_execute_mask_optimized_loading(api):
622622
}
623623
)
624624

625-
params = dummy_backend.last_load_collection_call('S2_FAPAR_CLOUDCOVER')
625+
params = dummy_backend.last_load_collection_call('ESA_WORLDCOVER_10M_2020_V1')
626626
assert params["spatial_extent"] == expected_spatial_extent
627627
assert isinstance(params.data_mask, DriverDataCube)
628628

@@ -651,7 +651,7 @@ def test_execute_mask_same_source(api):
651651
"y": "DV"
652652
},
653653
"process_id": "eq",
654-
"result": True
654+
"result": "true"
655655
}
656656
}
657657
}
@@ -706,7 +706,7 @@ def test_execute_mask_same_source(api):
706706
"y": 2
707707
},
708708
"process_id": "eq",
709-
"result": True
709+
"result": "true"
710710
}
711711
}
712712
}
@@ -731,15 +731,10 @@ def test_execute_mask_same_source(api):
731731
"sarbackscatter1": {
732732
"arguments": {
733733
"coefficient": "gamma0-terrain",
734-
"contributing_area": False,
735734
"data": {
736735
"from_node": "loadcollection1"
737736
},
738-
"elevation_model": "COPERNICUS_30",
739-
"ellipsoid_incidence_angle": False,
740-
"local_incidence_angle": False,
741-
"mask": True,
742-
"noise_removal": True
737+
"elevation_model": "COPERNICUS_30"
743738
},
744739
"process_id": "sar_backscatter"
745740
},
@@ -752,7 +747,7 @@ def test_execute_mask_same_source(api):
752747
"options": {}
753748
},
754749
"process_id": "save_result",
755-
"result": True
750+
"result": "true"
756751
}
757752
}
758753
})
@@ -986,7 +981,7 @@ def test_aggregate_spatial(api):
986981
"2015-07-06T00:00:00Z": [[2.345]],
987982
"2015-08-22T00:00:00Z": [[None]]
988983
}
989-
params = dummy_backend.last_load_collection_call("S2_FAPAR_CLOUDCOVER")
984+
params = dummy_backend.last_load_collection_call("ESA_WORLDCOVER_10M_2020_V1")
990985
assert params["spatial_extent"] == {
991986
"west": 7.02,
992987
"south": 51.29,
@@ -1034,7 +1029,7 @@ def test_aggregate_spatial_invalid_geometry(api, geometries, expected):
10341029
def test_aggregate_spatial_vector_cube_basic(api, feature_collection_test_path):
10351030
path = get_path(feature_collection_test_path)
10361031
pg = {
1037-
"lc": {"process_id": "load_collection", "arguments": {"id": "S2_FOOBAR", "bands": ["B02", "B03", "B04"]}},
1032+
"lc": {"process_id": "load_collection", "arguments": {"id": "ESA_WORLDCOVER_10M_2020_V1", "bands": ["B02", "B03", "B04"]}},
10381033
"lf": {
10391034
"process_id": "load_uploaded_files",
10401035
"arguments": {"paths": [str(path)], "format": "GeoJSON", "options": {"columns_for_cube": []}},
@@ -1057,7 +1052,7 @@ def test_aggregate_spatial_vector_cube_basic(api, feature_collection_test_path):
10571052
}
10581053
res = api.check_result(pg)
10591054

1060-
params = dummy_backend.last_load_collection_call("S2_FOOBAR")
1055+
params = dummy_backend.last_load_collection_call("ESA_WORLDCOVER_10M_2020_V1")
10611056
assert params["spatial_extent"] == {"west": 1, "south": 1, "east": 5, "north": 4, "crs": "EPSG:4326"}
10621057
assert isinstance(params["aggregate_spatial_geometries"], DriverVectorCube)
10631058

@@ -1203,7 +1198,7 @@ def test_aggregate_spatial_vector_cube_dimensions(
12031198
):
12041199
path = get_path("geojson/FeatureCollection02.json")
12051200
pg = {
1206-
"lc": {"process_id": "load_collection", "arguments": {"id": "S2_FOOBAR", "bands": ["B02", "B03", "B04"]}},
1201+
"lc": {"process_id": "load_collection", "arguments": {"id": "ESA_WORLDCOVER_10M_2020_V1", "bands": ["B02", "B03", "B04"]}},
12071202
"lf": {
12081203
"process_id": "load_uploaded_files",
12091204
"arguments": {"paths": [str(path)], "format": "GeoJSON", "options": {"columns_for_cube": []}},
@@ -1233,7 +1228,7 @@ def test_aggregate_spatial_vector_cube_dimensions(
12331228
pg.update(preprocess_pg)
12341229
res = api.check_result(pg)
12351230

1236-
params = dummy_backend.last_load_collection_call("S2_FOOBAR")
1231+
params = dummy_backend.last_load_collection_call("ESA_WORLDCOVER_10M_2020_V1")
12371232
assert params["spatial_extent"] == {"west": 1, "south": 1, "east": 5, "north": 4, "crs": "EPSG:4326"}
12381233
assert isinstance(params["aggregate_spatial_geometries"], DriverVectorCube)
12391234

@@ -2248,7 +2243,7 @@ def test_aggregate_feature_collection(api):
22482243
def test_aggregate_feature_collection_no_load_collection_spatial_extent(api):
22492244
preprocess = preprocess_regex_check_and_replace(r'"spatial_extent"\s*:\s*\{.*?\},', replacement='')
22502245
api.check_result("aggregate_feature_collection.json", preprocess=preprocess)
2251-
params = dummy_backend.last_load_collection_call('S2_FOOBAR')
2246+
params = dummy_backend.last_load_collection_call('ESA_WORLDCOVER_10M_2020_V1')
22522247
assert params["spatial_extent"] == {
22532248
"west": 5.076, "south": 51.21, "east": 5.166, "north": 51.26, "crs": 'EPSG:4326'
22542249
}

0 commit comments

Comments
 (0)