Separate flood hazards from surface water theme
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 22:35:48 +02:00
parent 943ecfbc90
commit 93f37d874e
2 changed files with 11 additions and 0 deletions
@@ -366,3 +366,5 @@ def test_flood_hazard_runtime_contract_is_packaged() -> None:
assert "COPY scripts/provision_mol_flood_hazards.py" in dockerfile assert "COPY scripts/provision_mol_flood_hazards.py" in dockerfile
assert "Overstromingsscenario" in frontend assert "Overstromingsscenario" in frontend
assert "floodHazardImageUrl" in frontend assert "floodHazardImageUrl" in frontend
assert "dataset.source_name === 'vmm_flood_hazard'" in frontend
assert "return theme.id === 'flood_hazard'" in frontend
@@ -147,6 +147,15 @@ function datasetSearchText(dataset: DatasetCreateResponse): string {
} }
function datasetMatchesTheme(dataset: DatasetCreateResponse, theme: DataTheme): boolean { function datasetMatchesTheme(dataset: DatasetCreateResponse, theme: DataTheme): boolean {
// Governed raster products have one unambiguous semantic theme. Matching
// them by generic substrings (for example "water" in "waterdiepte") would
// make a flood scenario replace the permanent surface-water layer.
if (dataset.source_name === 'vmm_flood_hazard') {
return theme.id === 'flood_hazard'
}
if (dataset.source_name === 'digitaal_vlaanderen_dhmv') {
return theme.id === 'elevation'
}
const searchText = datasetSearchText(dataset) const searchText = datasetSearchText(dataset)
return theme.tokens.some((token) => searchText.includes(token)) return theme.tokens.some((token) => searchText.includes(token))
} }