feat: make Mol explorer map-first
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-14 13:21:53 +02:00
parent e340b7f1ec
commit 2958c25b6f
24 changed files with 1901 additions and 14 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ def select_vector_features(
bbox=payload.bbox.model_dump(),
limit=payload.limit,
)
return envelope(VectorSelectionResponse(**result).model_dump())
return envelope(VectorSelectionResponse(**result).model_dump(exclude_none=True))
@router.post("/datasets/{dataset_id}/vector/select/derive", status_code=201, response_model=dict)
+1
View File
@@ -220,6 +220,7 @@ class VectorSelectionDeriveRequest(VectorSelectionRequest):
class VectorSelectionResponse(BaseModel):
selection_bbox: VectorSelectionBBox
feature_count: int
total_feature_count: int | None = None
limit: int
truncated: bool
geojson: dict
+11 -3
View File
@@ -92,7 +92,7 @@ class VectorFeatureService:
normalized_bbox = VectorFeatureService._normalize_selection_bbox(bbox)
safe_limit = max(1, min(int(limit), 1000))
rows = (
query = (
db.query(VectorFeature)
.filter(VectorFeature.dataset_id == dataset_id)
.filter(
@@ -107,17 +107,25 @@ class VectorFeatureService:
),
)
)
.order_by(VectorFeature.created_at.asc())
)
if hasattr(query, "count"):
total_feature_count = int(query.count())
else: # Lightweight unit-test sessions do not always implement Query.count().
total_feature_count = len(query.all())
rows = (
query.order_by(VectorFeature.created_at.asc())
.limit(safe_limit + 1)
.all()
)
truncated = len(rows) > safe_limit
truncated = total_feature_count > safe_limit
selected_rows = rows[:safe_limit]
features = [VectorFeatureService._row_to_geojson_feature(row) for row in selected_rows]
return {
"selection_bbox": normalized_bbox,
"feature_count": len(features),
"total_feature_count": total_feature_count,
"limit": safe_limit,
"truncated": truncated,
"geojson": {