Add governed VMM flood hazard scenarios
This commit is contained in:
@@ -9,6 +9,7 @@ const DATASET_LABEL_BY_LAYER: Record<string, string> = {
|
||||
forest: 'Bos en groen',
|
||||
nature_value: 'Natuurwaarde',
|
||||
agriculture: 'Landbouwgebruikspercelen',
|
||||
flood_hazard: 'Overstromingsgevaar',
|
||||
elevation: 'Hoogte en reliëf',
|
||||
building_registry: 'Gebouwenregister',
|
||||
regional_boundary: 'Grens vervoerregio Kempen',
|
||||
@@ -27,6 +28,7 @@ const DATASET_SOURCE_LABELS: Record<string, string> = {
|
||||
statbel: 'Statbel',
|
||||
vrbg: 'Digitaal Vlaanderen',
|
||||
waterinfo: 'Waterinfo Vlaanderen',
|
||||
vmm_flood_hazard: 'Vlaamse Milieumaatschappij',
|
||||
}
|
||||
|
||||
export function getDatasetSourceDisplayName(dataset: DatasetCreateResponse): string {
|
||||
@@ -39,6 +41,10 @@ export function getDatasetDisplayName(dataset: DatasetCreateResponse): string {
|
||||
const productName = dataset.source_metadata?.['product_display_name']
|
||||
return typeof productName === 'string' && productName.trim() ? productName : 'DHMV II hoogtemodel'
|
||||
}
|
||||
if (dataset.source_name === 'vmm_flood_hazard') {
|
||||
const productName = dataset.source_metadata?.['product_display_name']
|
||||
return typeof productName === 'string' && productName.trim() ? productName : 'VMM-overstromingsscenario'
|
||||
}
|
||||
const layer = (dataset.reference_layer_name ?? dataset.source_metadata?.layer_name ?? dataset.source_metadata?.layer_type ?? '')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export function floodHazardImageUrl(projectId: string, datasetId: string): string {
|
||||
return `/api/v1/projects/${projectId}/datasets/${datasetId}/raster/flood-hazard/image`
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { FloodHazardSelectionResponse, VectorSelectionResponse } from '../types'
|
||||
|
||||
export function floodHazardSelectionToMapSelection(result: FloodHazardSelectionResponse): VectorSelectionResponse {
|
||||
return {
|
||||
selection_bbox: result.selection_bbox,
|
||||
selection_area_id: result.selection_area_id,
|
||||
feature_count: result.inundated_cell_count,
|
||||
total_feature_count: result.inundated_cell_count,
|
||||
limit: 0,
|
||||
truncated: false,
|
||||
geojson: { type: 'FeatureCollection', features: [] },
|
||||
summary: {
|
||||
...result.summary,
|
||||
feature_count: result.inundated_cell_count,
|
||||
is_estimate: false,
|
||||
warning: result.limitation_message,
|
||||
metrics: result.summary.metrics.map((metric) => ({ ...metric, is_estimate: false })),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user