Support bounded Kempen-wide thematic rasters
This commit is contained in:
@@ -148,6 +148,29 @@ def test_request_is_bounded_allowlisted_and_uses_native_wcs_resolution() -> None
|
||||
assert exc_info.value.code == "THEMATIC_RASTER_PRODUCT_NOT_SUPPORTED"
|
||||
|
||||
|
||||
def test_complete_kempen_scope_fits_the_tiled_thematic_guardrails() -> None:
|
||||
settings = Settings(_env_file=None)
|
||||
request = ThematicRasterAcquireRequest(
|
||||
bbox={
|
||||
"min_x": 4.59723873,
|
||||
"min_y": 51.01047967,
|
||||
"max_x": 5.26224853,
|
||||
"max_y": 51.50511313,
|
||||
"crs": "EPSG:4326",
|
||||
},
|
||||
product_key="space_occupation_2025",
|
||||
)
|
||||
|
||||
prepared = ThematicRasterAcquisitionService._prepared_request(request, settings)
|
||||
|
||||
assert prepared["width"] * prepared["height"] <= 30_000_000
|
||||
assert len(ThematicRasterAcquisitionService._tile_bounds(prepared)) > 1
|
||||
|
||||
with pytest.raises(AppError) as exc_info:
|
||||
ThematicRasterAcquisitionService._prepared_request(payload(side_m=61_000.0), settings)
|
||||
assert exc_info.value.code == "THEMATIC_RASTER_SELECTION_TOO_LARGE"
|
||||
|
||||
|
||||
def test_binary_and_normalized_products_fail_closed_on_invalid_values() -> None:
|
||||
binary = ThematicRasterAcquisitionService._product("space_occupation_2025")
|
||||
score = ThematicRasterAcquisitionService._product("service_level_2022")
|
||||
|
||||
Reference in New Issue
Block a user