fix: expose WALOUS evolution rasters
This commit is contained in:
+3
-14
@@ -40,7 +40,7 @@ import { useMapSelectionQa } from './hooks/useMapSelectionQa'
|
||||
import { useMapWorkspaceState } from './hooks/useMapWorkspaceState'
|
||||
import { useMapSelectionExtract } from './hooks/useMapSelectionExtract'
|
||||
import { useMapOrthophotoAnalysis } from './hooks/useMapOrthophotoAnalysis'
|
||||
import { isDetectionImageryDataset } from './lib/datasetCapabilities'
|
||||
import { isDetectionImageryDataset, isMapRasterDataset } from './lib/datasetCapabilities'
|
||||
import { useProviderCapabilities } from './hooks/useProviderCapabilities'
|
||||
import { useProjectWorkspace } from './hooks/useProjectWorkspace'
|
||||
import { useQualityWorkflow } from './hooks/useQualityWorkflow'
|
||||
@@ -215,19 +215,8 @@ function App(): JSX.Element {
|
||||
const availableMapDatasets = useMemo(
|
||||
() => {
|
||||
const vectors = datasets.filter((dataset) => isVectorDatasetType(dataset.dataset_type) && dataset.status === 'ready')
|
||||
const terrain = datasets.filter(
|
||||
(dataset) => dataset.dataset_type === 'raster' && ['digitaal_vlaanderen_dhmv', 'spw_terrain'].includes(dataset.source_name ?? '') && dataset.status === 'ready',
|
||||
)
|
||||
const floodHazards = datasets.filter(
|
||||
(dataset) => dataset.dataset_type === 'raster' && dataset.source_name === 'vmm_flood_hazard' && dataset.status === 'ready',
|
||||
)
|
||||
const thematicRasters = datasets.filter(
|
||||
(dataset) => dataset.dataset_type === 'raster' && dataset.source_name === 'department_omgeving_thematic_raster' && dataset.status === 'ready',
|
||||
)
|
||||
const bathymetryRasters = datasets.filter(
|
||||
(dataset) => dataset.dataset_type === 'raster' && dataset.source_name === 'spw_bathymetry' && dataset.status === 'ready',
|
||||
)
|
||||
return [...vectors, ...terrain, ...floodHazards, ...thematicRasters, ...bathymetryRasters]
|
||||
const rasters = datasets.filter(isMapRasterDataset)
|
||||
return [...vectors, ...rasters]
|
||||
},
|
||||
[datasets],
|
||||
)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { DatasetCreateResponse } from '../types'
|
||||
import { isDetectionImageryDataset, isMapRasterDataset } from './datasetCapabilities'
|
||||
|
||||
function raster(sourceName: string, status = 'ready'): DatasetCreateResponse {
|
||||
return {
|
||||
id: sourceName,
|
||||
name: sourceName,
|
||||
dataset_type: 'raster',
|
||||
source: sourceName,
|
||||
source_name: sourceName,
|
||||
project_id: 'project-id',
|
||||
status,
|
||||
}
|
||||
}
|
||||
|
||||
describe('dataset capabilities', () => {
|
||||
it('keeps every governed map raster, including WALOUS snapshots, available to the map', () => {
|
||||
expect(isMapRasterDataset(raster('spw_walous_land_cover'))).toBe(true)
|
||||
expect(isMapRasterDataset(raster('spw_terrain'))).toBe(true)
|
||||
expect(isMapRasterDataset(raster('unclassified_uploaded_imagery'))).toBe(false)
|
||||
expect(isMapRasterDataset(raster('spw_walous_land_cover', 'processing'))).toBe(false)
|
||||
})
|
||||
|
||||
it('does not offer governed thematic rasters as AI detection imagery', () => {
|
||||
expect(isDetectionImageryDataset(raster('spw_walous_land_cover'))).toBe(false)
|
||||
expect(isDetectionImageryDataset(raster('unclassified_uploaded_imagery'))).toBe(true)
|
||||
})
|
||||
})
|
||||
@@ -9,6 +9,21 @@ const NON_IMAGERY_RASTER_SOURCES = new Set([
|
||||
'spw_walous_land_cover',
|
||||
])
|
||||
|
||||
const MAP_RASTER_SOURCES = new Set([
|
||||
'department_omgeving_thematic_raster',
|
||||
'digitaal_vlaanderen_dhmv',
|
||||
'spw_terrain',
|
||||
'vmm_flood_hazard',
|
||||
'spw_bathymetry',
|
||||
'spw_walous_land_cover',
|
||||
])
|
||||
|
||||
export function isMapRasterDataset(dataset: DatasetCreateResponse): boolean {
|
||||
return dataset.dataset_type === 'raster'
|
||||
&& dataset.status === 'ready'
|
||||
&& MAP_RASTER_SOURCES.has(dataset.source_name ?? '')
|
||||
}
|
||||
|
||||
export function isDetectionImageryDataset(dataset: DatasetCreateResponse): boolean {
|
||||
if (dataset.dataset_type !== 'raster' || dataset.status !== 'ready') {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user