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
@@ -284,6 +284,8 @@ class VectorOperationsService:
db: Session,
dataset_id: uuid.UUID,
bbox: dict[str, Any],
selection_geometry: Any | None = None,
selection_area_id: uuid.UUID | None = None,
limit: int = 250,
output_name: str | None = None,
) -> DatasetCreateResponse:
@@ -292,7 +294,14 @@ class VectorOperationsService:
raise AppError(code="DATASET_NOT_FOUND", message="Dataset not found", status_code=404)
VectorOperationsService._require_vector_dataset(source_dataset)
selection = VectorFeatureService.select_features_by_bbox(db, dataset_id=dataset_id, bbox=bbox, limit=limit)
selection = VectorFeatureService.select_features_by_bbox(
db,
dataset_id=dataset_id,
bbox=bbox,
selection_geometry=selection_geometry,
selection_area_id=selection_area_id,
limit=limit,
)
if selection["feature_count"] <= 0:
raise AppError(
code="VECTOR_OPERATION_EMPTY_RESULT",
@@ -316,6 +325,7 @@ class VectorOperationsService:
source_name="map_selection",
source_metadata={
"selection_bbox": selection["selection_bbox"],
"selection_area_id": selection.get("selection_area_id"),
"feature_count": selection["feature_count"],
"limit": selection["limit"],
"truncated": selection["truncated"],
@@ -326,9 +336,11 @@ class VectorOperationsService:
"source_dataset_id": str(dataset_id),
"source_table": "vector_features",
"selection_bbox": selection["selection_bbox"],
"selection_area_id": selection.get("selection_area_id"),
},
metadata_extra={
"selection_bbox": selection["selection_bbox"],
"selection_area_id": selection.get("selection_area_id"),
"source_feature_count": selection["feature_count"],
"selection_limit": selection["limit"],
"selection_truncated": selection["truncated"],