Add map area selection extraction
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-25 01:59:57 +02:00
parent 00de5dbcb7
commit 851d7220df
18 changed files with 1063 additions and 2 deletions
+49
View File
@@ -357,6 +357,55 @@ Return vector stats (feature counts and geometry summary).
Return vector bounds and feature count.
### POST `/api/v1/projects/{project_id}/datasets/{dataset_id}/vector/select`
Read-only spatial selection over persisted `vector_features`.
Request:
```json
{
"bbox": {
"min_x": 5.0,
"min_y": 51.0,
"max_x": 5.1,
"max_y": 51.1,
"crs": "EPSG:4326"
},
"limit": 250
}
```
Response:
```json
{
"data": {
"selection_bbox": {
"min_x": 5.0,
"min_y": 51.0,
"max_x": 5.1,
"max_y": 51.1,
"crs": "EPSG:4326"
},
"feature_count": 2,
"limit": 250,
"truncated": false,
"geojson": {
"type": "FeatureCollection",
"features": []
}
}
}
```
Rules:
- Only vector/GeoJSON datasets are supported.
- Coordinates are EPSG:4326 longitude/latitude.
- Results are generated from persisted PostGIS `vector_features`, not from client-side map data.
- The response is capped by `limit` and returns `truncated=true` when more matching rows exist.
### GET `/api/v1/projects/{project_id}/datasets/{dataset_id}/content`
Returns stored vector dataset content through the canonical API envelope.
+32
View File
@@ -1,3 +1,35 @@
## Sprint 106 Map area selection extract (2026-06-25)
Changed:
- Added `POST /api/v1/projects/{project_id}/datasets/{dataset_id}/vector/select` for read-only bbox selection over persisted PostGIS `vector_features`.
- Added `VectorSelectionBBox`, `VectorSelectionRequest` and `VectorSelectionResponse` schemas and exported them through the backend schema module.
- Added `VectorFeatureService.select_features_by_bbox`, including EPSG:4326 bbox validation, feature limit capping, PostGIS `ST_Intersects` query and GeoJSON FeatureCollection conversion from persisted geometries.
- Added frontend `selectVectorFeatures` API client support and `useMapSelectionExtract`.
- Extended the Map workspace with an `Area selection` panel, two-click map bbox selection, manual bbox inputs, selected-feature/AOI/active-layer bbox shortcuts, area GeoJSON download/copy actions and a compact selected-feature table.
- Extended `GeoMap` with `selection-bbox` and `selection-result` MapLibre GeoJSON overlays.
- Updated `docs/API_CONTRACTS.md`, `frontend/README.md`, `backend/README.md`, `CHANGELOG.md` and `docs/TODO.md`.
- Added regression coverage in `backend/tests/test_sprint106_map_bbox_extract.py`.
Validation:
- RED: `python -m pytest backend\tests\test_sprint106_map_bbox_extract.py -q` failed before implementation because the vector selection service, route and frontend contracts were absent.
- `python -m pytest backend\tests\test_sprint106_map_bbox_extract.py -q` passed: 5 tests.
- `python -m compileall backend/app` passed.
- `cd backend && python -m pytest -q` passed: 338 tests.
- `cd frontend && npm run typecheck` passed.
- `cd frontend && npm run build` passed.
- `bash scripts/run_readiness_check.sh` passed.
- `cd backend && python -m alembic heads` passed: `202606120900 (head)`.
- `cd backend && python -m alembic upgrade head --sql` passed.
- `bash -n scripts/live_migration_smoke.sh` passed.
Limitations:
- Selection shape is bbox-only in EPSG:4326. Polygon/lasso selection remains future work.
- The endpoint is read-only and does not create exports or derived datasets; operators can download the selected GeoJSON client-side.
- No migrations, live provider fetching, AI dependency, real model behavior or new product domain were added.
Next recommended pass:
- Add a browser/live smoke around the area selection panel after deploy, then consider export-center handoff for persisted selection artifacts if V1 needs server-side audit retention.
## Sprint 105 Map feature extract (2026-06-25)
Changed:
+1
View File
@@ -372,3 +372,4 @@ This file now starts with the current implementation status. Older preparation/b
- [x] Make raster tile handoff to Detection Lab auto-select the configured YOLO run form.
- [x] Add AI Lab run-readiness checks for Detection and Segmentation before job submission.
- [x] Add AI Lab action guardrails so explicit fixture models are not exposed as normal operator runs.
- [x] Add persisted vector area selection from the Map workspace with bbox extract and GeoJSON download.