Constrain selections to active work areas
This commit is contained in:
@@ -227,14 +227,20 @@ class ExportService:
|
||||
area = db.get(Area, area_id)
|
||||
if not area or area.project_id != dataset.project_id:
|
||||
raise AppError(code="AREA_NOT_FOUND", message="Area not found", status_code=404)
|
||||
full_dataset_area = VectorFeatureService.can_use_full_area_fast_path(dataset, area.id)
|
||||
preclipped_partition_filter = (
|
||||
None
|
||||
if full_dataset_area
|
||||
else VectorFeatureService.preclipped_partition_filter(dataset, getattr(area, "name", None))
|
||||
selection_geometry, covers_full_area = VectorFeatureService.constrain_bbox_to_area(
|
||||
bbox,
|
||||
area.geometry,
|
||||
)
|
||||
full_dataset_area = covers_full_area and VectorFeatureService.can_use_full_area_fast_path(
|
||||
dataset,
|
||||
area.id,
|
||||
)
|
||||
preclipped_partition_filter = VectorFeatureService.preclipped_partition_filter(
|
||||
dataset,
|
||||
getattr(area, "name", None),
|
||||
)
|
||||
selection_kwargs.update(
|
||||
selection_geometry=area.geometry,
|
||||
selection_geometry=selection_geometry,
|
||||
selection_area_id=area.id,
|
||||
full_dataset_area=full_dataset_area,
|
||||
preclipped_partition_filter=preclipped_partition_filter,
|
||||
|
||||
Reference in New Issue
Block a user