feat: add cross-domain Mol data profile
This commit is contained in:
@@ -9,8 +9,13 @@ const DATASET_LABEL_BY_LAYER: Record<string, string> = {
|
||||
forest: 'Bos en groen',
|
||||
nature_value: 'Natuurwaarde',
|
||||
agriculture: 'Landbouwgebruikspercelen',
|
||||
soil: 'Digitale bodemkaart',
|
||||
flood_hazard: 'Overstromingsgevaar',
|
||||
elevation: 'Hoogte en reliëf',
|
||||
space_occupation: 'Ruimtebeslag',
|
||||
open_space: 'Open ruimte',
|
||||
accessibility: 'Knooppuntwaarde',
|
||||
services: 'Voorzieningenniveau',
|
||||
building_registry: 'Gebouwenregister',
|
||||
regional_boundary: 'Grens vervoerregio Kempen',
|
||||
municipality_boundaries: 'Gemeentegrenzen Kempen',
|
||||
@@ -29,6 +34,8 @@ const DATASET_SOURCE_LABELS: Record<string, string> = {
|
||||
vrbg: 'Digitaal Vlaanderen',
|
||||
waterinfo: 'Waterinfo Vlaanderen',
|
||||
vmm_flood_hazard: 'Vlaamse Milieumaatschappij',
|
||||
department_omgeving_thematic_raster: 'Departement Omgeving',
|
||||
dov_soil_map: 'Databank Ondergrond Vlaanderen',
|
||||
}
|
||||
|
||||
export function getDatasetSourceDisplayName(dataset: DatasetCreateResponse): string {
|
||||
@@ -45,6 +52,10 @@ export function getDatasetDisplayName(dataset: DatasetCreateResponse): string {
|
||||
const productName = dataset.source_metadata?.['product_display_name']
|
||||
return typeof productName === 'string' && productName.trim() ? productName : 'VMM-overstromingsscenario'
|
||||
}
|
||||
if (dataset.source_name === 'department_omgeving_thematic_raster') {
|
||||
const productName = dataset.source_metadata?.['product_display_name']
|
||||
return typeof productName === 'string' && productName.trim() ? productName : 'Officieel Vlaams themaraster'
|
||||
}
|
||||
const layer = (dataset.reference_layer_name ?? dataset.source_metadata?.layer_name ?? dataset.source_metadata?.layer_type ?? '')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
|
||||
@@ -35,6 +35,9 @@ const sourceNameIs = (dataset: DatasetCreateResponse, sourceName: string): boole
|
||||
const referenceLayerIs = (dataset: DatasetCreateResponse, layerName: string): boolean =>
|
||||
String(dataset.reference_layer_name ?? dataset.source_metadata?.['theme'] ?? '').toLowerCase() === layerName
|
||||
|
||||
const thematicProductIs = (dataset: DatasetCreateResponse, productKey: string): boolean =>
|
||||
sourceNameIs(dataset, 'department_omgeving_thematic_raster') && dataset.source_metadata?.['product_key'] === productKey
|
||||
|
||||
export const SOURCE_DOMAINS: SourceDomainDefinition[] = [
|
||||
{
|
||||
key: 'space',
|
||||
@@ -127,7 +130,7 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
metricExamples: 'hectare ruimtebeslag, aandeel, vergelijking met open ruimte',
|
||||
priority: 'next',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/ruimtebeslag-vlaanderen-toestand-2025',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_space_occupation'),
|
||||
matches: (dataset) => thematicProductIs(dataset, 'space_occupation_2025'),
|
||||
},
|
||||
{
|
||||
key: 'settlement_typology',
|
||||
@@ -137,7 +140,7 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
coverage: 'Toestand 2022',
|
||||
value: 'Begrijpelijke morfologie voor kern, lint en verspreide bebouwing.',
|
||||
metricExamples: 'oppervlakte en aandeel per morfologisch type',
|
||||
priority: 'planned',
|
||||
priority: 'next',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/kernen-linten-verspreide-bebouwing-in-vlaanderen-kernen-toestand-2022',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_settlement_typology'),
|
||||
},
|
||||
@@ -187,7 +190,7 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
metricExamples: 'hectare open ruimte, aandeel en fragmentatie',
|
||||
priority: 'planned',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/open-ruimte-vlaanderen-toestand-2022',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_open_space'),
|
||||
matches: (dataset) => thematicProductIs(dataset, 'open_space_2022'),
|
||||
},
|
||||
{
|
||||
key: 'dhmv',
|
||||
@@ -244,10 +247,10 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
owner: 'Departement Omgeving',
|
||||
coverage: '1 ha raster, toestand 2022',
|
||||
value: 'Modelmatige bereikbaarheid via collectief vervoer.',
|
||||
metricExamples: 'gemiddelde score en aandeel per bereikbaarheidsklasse',
|
||||
metricExamples: 'gemiddelde, mediaan en percentielen van de bronindex',
|
||||
priority: 'next',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/knooppuntwaarde-per-ha-toestand-2022',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_node_value'),
|
||||
matches: (dataset) => thematicProductIs(dataset, 'node_value_2022'),
|
||||
},
|
||||
{
|
||||
key: 'hoppin',
|
||||
@@ -295,7 +298,7 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
metricExamples: 'geschat aantal inwoners en inwoners per hectare',
|
||||
priority: 'next',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/inwonersdichtheid-per-ha-vlaanderen-toestand-2019',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_population_density'),
|
||||
matches: (dataset) => thematicProductIs(dataset, 'population_density_2019'),
|
||||
},
|
||||
{
|
||||
key: 'service_level',
|
||||
@@ -304,10 +307,10 @@ export const OFFICIAL_SOURCE_PORTFOLIO: OfficialSourceDefinition[] = [
|
||||
owner: 'Departement Omgeving',
|
||||
coverage: '1 ha raster, toestand 2022',
|
||||
value: 'Nabijheid van dagelijkse voorzieningen in één brongetrouwe score.',
|
||||
metricExamples: 'gemiddelde score en aandeel per voorzieningsklasse',
|
||||
metricExamples: 'gemiddelde, mediaan en percentielen van de 0-1-score',
|
||||
priority: 'next',
|
||||
url: 'https://www.vlaanderen.be/datavindplaats/catalogus/totaal-voorzieningenniveau-toestand-2022',
|
||||
matches: (dataset) => sourceNameIs(dataset, 'department_omgeving_service_level'),
|
||||
matches: (dataset) => thematicProductIs(dataset, 'service_level_2022'),
|
||||
},
|
||||
{
|
||||
key: 'municipality_indicators',
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { ThematicRasterSelectionResponse, VectorSelectionResponse } from '../types'
|
||||
|
||||
export function thematicRasterImageUrl(projectId: string, datasetId: string): string {
|
||||
return `/api/v1/projects/${projectId}/datasets/${datasetId}/raster/thematic/image`
|
||||
}
|
||||
|
||||
export function thematicRasterSelectionToMapSelection(result: ThematicRasterSelectionResponse): VectorSelectionResponse {
|
||||
return {
|
||||
selection_bbox: result.selection_bbox,
|
||||
selection_area_id: result.selection_area_id,
|
||||
feature_count: result.valid_cell_count,
|
||||
total_feature_count: result.valid_cell_count,
|
||||
limit: 0,
|
||||
truncated: false,
|
||||
geojson: { type: 'FeatureCollection', features: [] },
|
||||
summary: {
|
||||
...result.summary,
|
||||
feature_count: result.valid_cell_count,
|
||||
is_estimate: true,
|
||||
warning: result.limitation_message,
|
||||
metrics: result.summary.metrics.map((metric) => ({
|
||||
...metric,
|
||||
is_estimate: metric.is_estimate ?? true,
|
||||
})),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user