Align historical metrics with polygon semantics
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user