Align historical metrics with polygon semantics
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 23:49:30 +02:00
parent 63e61627a9
commit df015e10e0
4 changed files with 38 additions and 2 deletions
+12 -1
View File
@@ -30,6 +30,12 @@ FULL_AREA_CLIPPED_OPERATOR_TOOLS = {
"provision_buildings_addresses_register.py",
}
SEMANTIC_METRICS_DISABLED_OPERATOR_TOOLS = {
# Historical land-use themes are polygon map classes. Generic live-theme
# line metrics (road/watercourse length) would therefore be meaningless.
"provision_regional_historical_landuse.py",
}
SEMANTIC_SELECTION_METRICS: dict[str, tuple[dict[str, Any], ...]] = {
"buildings": (
@@ -379,9 +385,14 @@ class VectorFeatureService:
"is_estimate": bool(config.get("is_estimate", False)),
**({"property": config.get("property")} if config.get("property") else {}),
}
provenance = dataset.provenance_metadata if isinstance(dataset.provenance_metadata, dict) else {}
semantic_metrics_disabled = (
source_metadata.get("semantic_metrics") is False
or provenance.get("operator_tool") in SEMANTIC_METRICS_DISABLED_OPERATOR_TOOLS
)
semantic_metrics = (
[]
if source_metadata.get("semantic_metrics") is False
if semantic_metrics_disabled
else [dict(metric) for metric in SEMANTIC_SELECTION_METRICS.get(theme or "", ())]
)
primary_config = configured_metric