Aggregate regional bathymetry partitions
This commit is contained in:
@@ -257,6 +257,41 @@ def finalize_bathymetry_profile_partitions(
|
||||
return envelope(BathymetryProfileAcquisitionService.finalize_partitions(db, project_id, payload))
|
||||
|
||||
|
||||
@router.post("/datasets/bathymetry/profiles/partitions/select", response_model=dict)
|
||||
def select_bathymetry_profile_partitions(
|
||||
project_id: UUID,
|
||||
payload: VectorSelectionRequest,
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
selection_geometry = None
|
||||
selection_area_id = None
|
||||
partition_area_id = None
|
||||
if payload.area_id is not None:
|
||||
selection_area = db.get(Area, payload.area_id)
|
||||
if selection_area is None or selection_area.project_id != project_id:
|
||||
raise AppError(code="AREA_NOT_FOUND", message="Area not found", status_code=404)
|
||||
selection_geometry, _covers_full_area = VectorFeatureService.constrain_bbox_to_area(
|
||||
payload.bbox.model_dump(),
|
||||
selection_area.geometry,
|
||||
)
|
||||
selection_area_id = selection_area.id
|
||||
if str(selection_area.name or "").lower().startswith("gemeente "):
|
||||
partition_area_id = selection_area.id
|
||||
|
||||
result = VectorFeatureService.select_partitioned_features_by_bbox(
|
||||
db,
|
||||
project_id=project_id,
|
||||
source_name=BathymetryProfileAcquisitionService.PROVIDER,
|
||||
partition_scope_key="flanders",
|
||||
bbox=payload.bbox.model_dump(),
|
||||
limit=payload.limit,
|
||||
selection_geometry=selection_geometry,
|
||||
selection_area_id=selection_area_id,
|
||||
partition_area_id=partition_area_id,
|
||||
)
|
||||
return envelope(VectorSelectionResponse(**result).model_dump(exclude_none=True))
|
||||
|
||||
|
||||
@router.post("/datasets/thematic-raster/acquire", response_model=dict)
|
||||
def acquire_bounded_thematic_raster(
|
||||
project_id: UUID,
|
||||
|
||||
Reference in New Issue
Block a user