Add bounded Flanders thematic analysis
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user