Constrain visible roof grouping to compact clusters
This commit is contained in:
@@ -179,3 +179,25 @@ def test_normalizer_merges_only_touching_visible_roof_instances(tmp_path: Path)
|
||||
assert sorted(item["properties"]["source_feature_count"] for item in normalized["features"]) == [1, 2]
|
||||
assert audit["accepted_source_feature_count"] == 3
|
||||
assert audit["accepted_feature_count"] == 2
|
||||
|
||||
|
||||
def test_visible_roof_merge_retains_large_touching_chains() -> None:
|
||||
features = []
|
||||
for index in range(13):
|
||||
left = float(index)
|
||||
features.append(
|
||||
{
|
||||
"type": "Feature",
|
||||
"id": str(index),
|
||||
"properties": {"source_feature_id": str(index)},
|
||||
"geometry": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [[[left, 0], [left + 1, 0], [left + 1, 1], [left, 1], [left, 0]]],
|
||||
},
|
||||
}
|
||||
)
|
||||
merged = module.merge_touching_roof_instances(features, "grb")
|
||||
assert len(merged) == 13
|
||||
assert {item["properties"]["label_semantics"] for item in merged} == {
|
||||
"native_instance_complex_touch_group"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user