Fix canonical municipality partition parsing
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-16 00:49:03 +02:00
parent bcbdaa10fc
commit 3b94dbc9c7
2 changed files with 3 additions and 9 deletions
@@ -198,15 +198,9 @@ class VectorFeatureService:
return None
normalized_name = str(selection_area_name or "").strip()
prefix = "Gemeente "
suffixes = (" - officiële grens", " - officiele grens")
if not normalized_name.startswith(prefix):
return None
municipality = normalized_name[len(prefix):]
for suffix in suffixes:
if municipality.endswith(suffix):
municipality = municipality[: -len(suffix)]
break
municipality = municipality.strip()
municipality = normalized_name[len(prefix):].split(" - ", 1)[0].strip()
return ("municipality", municipality) if municipality else None
@staticmethod