Add governed orthophoto release promotion
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 02:17:04 +02:00
parent 20d3aae1fb
commit 06d05f03a6
14 changed files with 1579 additions and 28 deletions
@@ -37,7 +37,7 @@ _WFS = "http://www.opengis.net/wfs/2.0"
_XLINK = "http://www.w3.org/1999/xlink"
_METADATA_HOST = "metadata.vlaanderen.be"
_VERSION_DATE = re.compile(r"^(?:toestand\s+)?(\d{4}-\d{2}-\d{2})$", re.IGNORECASE)
_ORTHOPHOTO_EDITION = re.compile(r"^\d{4}\.\d{2}$")
_ORTHOPHOTO_EDITION = re.compile(r"^(20\d{2})\.(\d{2})$")
_ALZ_SOURCE_NAME = "agentschap_landbouw_zeevisserij_agricultural_parcels"
_ALZ_RELEASE_HOST = "landbouwcijfers.vlaanderen.be"
_ALZ_RELEASE_PATH = "/open-geodata-landbouwgebruikspercelen"
@@ -681,6 +681,19 @@ def _dataset_source_name(dataset: Dataset) -> str:
def _latest_local_version(source_name: str, datasets: list[Dataset]) -> str | None:
candidates = [item for item in datasets if _dataset_source_name(item) == source_name and item.source_version]
if source_name == "digitaal_vlaanderen_orthophoto":
official_editions = [
item for item in candidates if _ORTHOPHOTO_EDITION.fullmatch((item.source_version or "").strip())
]
if official_editions:
latest = max(
official_editions,
key=lambda item: (
tuple(int(value) for value in (item.source_version or "0.0").split(".")),
_utc(item.imported_at) if item.imported_at else datetime.min.replace(tzinfo=timezone.utc),
str(item.id),
),
)
return latest.source_version
explicit_current = [
item
for item in candidates