Add bounded Flanders thematic analysis
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 18:28:48 +02:00
parent 21103441cf
commit ce597ee0b4
17 changed files with 389 additions and 55 deletions
@@ -304,6 +304,15 @@ class ThematicRasterAcquisitionService:
raise AppError(code="THEMATIC_RASTER_SELECTION_OUTSIDE_AREA", message="Selection does not overlap the selected work area", status_code=422)
return intersection
@staticmethod
def _coverage_scope(db, area_id: UUID | None) -> str:
if area_id is None:
return "bounded_selection"
area = db.get(Area, area_id)
if area and str(area.name).casefold().startswith("gemeente "):
return "municipality"
return "bounded_selection"
@staticmethod
def _fetch(request_url: str, settings: Settings, opener: Callable[..., Any] | None = None) -> tuple[bytes, str]:
request = Request(request_url, headers={"Accept": "image/tiff,*/*", "User-Agent": "GeoIntel/0.1 bounded-thematic-raster"})
@@ -568,7 +577,7 @@ class ThematicRasterAcquisitionService:
"license_note": ThematicRasterAcquisitionService.LICENSE_NOTE,
"legend_min_label": product.legend_min_label,
"legend_max_label": product.legend_max_label,
"coverage_scope": "municipality" if payload.area_id else "bounded_selection",
"coverage_scope": ThematicRasterAcquisitionService._coverage_scope(db, payload.area_id),
},
provenance_metadata={
"acquisition": "explicit_bounded_tiled_wcs_coverage",