Files
geointel/frontend/src/lib/terrainSelection.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

27 lines
989 B
TypeScript

import type { TerrainSelectionResponse, VectorSelectionResponse } from '../types'
export function terrainSelectionToMapSelection(result: TerrainSelectionResponse): VectorSelectionResponse {
return {
selection_bbox: result.selection_bbox,
selection_area_id: result.selection_area_id,
feature_count: 0,
total_feature_count: 0,
limit: 0,
truncated: false,
geojson: { type: 'FeatureCollection', features: [] },
summary: {
...result.summary,
feature_count: result.sample_count,
is_estimate: false,
// 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: false,
})),
},
}
}