Files
geointel/frontend/src/lib/thematicRaster.ts
T
JensandClaude Opus 5 b146b2143d surface the new analysis caveats in the workbench
The backend now says when a result covers a different area than was drawn, or
when a score belongs to one confidence cut only. None of that helps an
operator while it stays in the response body.

- the raster selection adapters carry the model-coverage and widened-cell
  warnings into the map panel and mark the result an estimate when either
  applies, so an existing warning slot renders them;
- the map workspace shows the selection-edge disclosure next to the object
  count;
- the detection panel shows average precision and the F1-optimal threshold
  beside the single-threshold figures, and the box-versus-footprint
  interpretation when candidates are detector boxes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 14:33:54 +02:00

35 lines
1.4 KiB
TypeScript

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 walousRasterImageUrl(projectId: string, datasetId: string): string {
return `/api/v1/projects/${projectId}/datasets/${datasetId}/raster/walous/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,
// A selection finer than one source cell was widened to the cells it
// touches; the result then covers more ground than was drawn.
warning: [result.cell_selection_warning, result.limitation_message].filter(Boolean).join(' '),
selection_edge_warning: result.cell_selection_warning ?? null,
metrics: result.summary.metrics.map((metric) => ({
...metric,
is_estimate: metric.is_estimate ?? true,
})),
},
}
}