Normalize clearance limit object types in final PBF

This commit is contained in:
OpenAI Codex
2026-04-02 08:29:37 +08:00
parent 858ab70500
commit a6b645f673
4 changed files with 44 additions and 7 deletions

View File

@@ -78,6 +78,14 @@ FINAL_RELEASE_PROPERTY_ALLOWLIST = frozenset(
)
def normalize_release_canonical_object_type(source_layer: str, canonical_object_type: str) -> str:
if source_layer == "p高さ制限":
return "clearance_limit_point"
if source_layer == "L高さ制限":
return "clearance_limit_line"
return canonical_object_type
@dataclass(frozen=True)
class DbConfig:
host: str = "localhost"
@@ -525,7 +533,11 @@ class NavSeaTileBuilder:
properties["source_layer_rule_id"] = source_layer_rule_id
properties["feature_id"] = row["feature_id"]
properties["canonical_object_type"] = row["canonical_object_type"]
canonical_object_type = normalize_release_canonical_object_type(
source_layer_jp,
text_or_none(row["canonical_object_type"]) or "",
)
properties["canonical_object_type"] = canonical_object_type
properties["canonical_family"] = row["canonical_family"]
properties["semantic_key"] = row["semantic_key"]
properties["detection_key"] = row["detection_key"]
@@ -534,7 +546,7 @@ class NavSeaTileBuilder:
properties=properties,
source_layer=source_layer_jp,
output_layer=output_layer,
canonical_object_type=text_or_none(row["canonical_object_type"]) or "",
canonical_object_type=canonical_object_type,
canonical_family=text_or_none(row["canonical_family"]) or "",
geom_type=str(source_feature.get("geometry", {}).get("type", "")),
feature_id=int(row["feature_id"]),
@@ -546,7 +558,7 @@ class NavSeaTileBuilder:
properties, field_name_unresolved = self.standardize_output_properties(
properties=properties,
source_layer=source_layer_jp,
canonical_object_type=text_or_none(row["canonical_object_type"]) or "",
canonical_object_type=canonical_object_type,
canonical_family=text_or_none(row["canonical_family"]) or "",
geom_type=str(source_feature.get("geometry", {}).get("type", "")),
feature_id=int(row["feature_id"]),