Constrain selections to active work areas
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-17 12:58:38 +02:00
parent a29c787238
commit d652db6a1e
20 changed files with 329 additions and 71 deletions
+8 -3
View File
@@ -28,6 +28,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 { useProviderCapabilities } from './hooks/useProviderCapabilities'
import { useProjectWorkspace } from './hooks/useProjectWorkspace'
import { useQualityWorkflow } from './hooks/useQualityWorkflow'
@@ -211,6 +212,10 @@ function App(): JSX.Element {
[availableVectorDatasets],
)
const rasterDatasets = useMemo(() => datasets.filter((item) => item.dataset_type === 'raster'), [datasets])
const detectionRasterDatasets = useMemo(
() => rasterDatasets.filter(isDetectionImageryDataset),
[rasterDatasets],
)
const {
providers,
loadingCapabilities,
@@ -317,14 +322,14 @@ function App(): JSX.Element {
setCalibrationThresholdText,
} = useDetectionWorkflow({
selectedProjectId,
rasterDatasets,
rasterDatasets: detectionRasterDatasets,
qaIouThreshold,
loadProjectData,
loadQualityChecks,
})
const useRasterTileManifestForDetection = () => {
const manifestPath = latestRasterTileManifestPath.trim()
if (!manifestPath || !selectedDataset || selectedDataset.dataset_type !== 'raster') {
if (!manifestPath || !selectedDataset || !isDetectionImageryDataset(selectedDataset)) {
return
}
setDetectionTileManifestPath(manifestPath)
@@ -1171,7 +1176,7 @@ function App(): JSX.Element {
loadingYoloPreflight={loadingYoloPreflight}
yoloPreflightError={yoloPreflightError}
selectedProjectId={selectedProjectId}
rasterDatasets={rasterDatasets}
rasterDatasets={detectionRasterDatasets}
referenceDatasets={referenceDatasets}
onLoadModels={loadDetectionModels}
onRefreshYoloPreflight={() => loadYoloPreflight()}
+3 -8
View File
@@ -1154,12 +1154,7 @@ export function MapWorkspace({
}
const areaIdForSelection = (bbox: VectorSelectionBBox | null): string | undefined => (
bbox
&& selectedMapArea
&& selectedAreaBbox
&& bboxesEqual(bbox, selectedAreaBbox)
? selectedMapArea.id
: undefined
bbox && selectedMapArea ? selectedMapArea.id : undefined
)
const startBboxSelection = () => {
@@ -1178,7 +1173,7 @@ export function MapWorkspace({
setSelectionBbox(bbox)
setFirstSelectionCorner(null)
setBboxSelectionMode(false)
void analyzeSelection(bbox)
void analyzeSelection(bbox, areaIdForSelection(bbox))
}
const runAreaExtract = () => {
@@ -1387,7 +1382,7 @@ export function MapWorkspace({
const handleMapBboxSelect = (bbox: VectorSelectionBBox) => {
setFirstSelectionCorner(null)
setBboxSelectionMode(false)
void analyzeSelection(bbox)
void analyzeSelection(bbox, areaIdForSelection(bbox))
}
const runQuickAoiExtract = () => {
+17
View File
@@ -0,0 +1,17 @@
import type { DatasetCreateResponse } from '../types'
const NON_IMAGERY_RASTER_SOURCES = new Set([
'department_omgeving_thematic_raster',
'digitaal_vlaanderen_dhmv',
'vmm_flood_hazard',
])
export function isDetectionImageryDataset(dataset: DatasetCreateResponse): boolean {
if (dataset.dataset_type !== 'raster' || dataset.status !== 'ready') {
return false
}
if (NON_IMAGERY_RASTER_SOURCES.has(dataset.source_name ?? '')) {
return false
}
return true
}