Separate flood hazards from surface water theme
This commit is contained in:
@@ -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))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user