fix: expose WALOUS evolution rasters
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-22 06:49:16 +02:00
parent 107099c101
commit 5a3e7c679b
3 changed files with 47 additions and 14 deletions
@@ -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)
})
})
+15
View File
@@ -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