feat(extract): Beschriftungen in run.py entfernen, Minimap am Ende erzeugen
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97ff63b2b6
commit
b219013bbf
1 file changed
+8
@@ -2,6 +2,7 @@
|
|||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from leonida.annotations import load_annotations, mark_generated, remove_annotations
|
||||||
from leonida.buildings import building_polygons
|
from leonida.buildings import building_polygons
|
||||||
from leonida.classify import CLASSES, class_shares, classify, drop_map_labels
|
from leonida.classify import CLASSES, class_shares, classify, drop_map_labels
|
||||||
from leonida.emit import (chunk_box_of, chunk_payload, in_chunk, split_by_chunk_all,
|
from leonida.emit import (chunk_box_of, chunk_payload, in_chunk, split_by_chunk_all,
|
||||||
@@ -9,6 +10,7 @@ from leonida.emit import (chunk_box_of, chunk_payload, in_chunk, split_by_chunk_
|
|||||||
from leonida.heights import assign_heights, palm_points
|
from leonida.heights import assign_heights, palm_points
|
||||||
from leonida.tiles import COMMIT, download_tiles, load_mosaic
|
from leonida.tiles import COMMIT, download_tiles, load_mosaic
|
||||||
from leonida.vectors import centerlines, land_polygons, mask_polygons, road_polygons
|
from leonida.vectors import centerlines, land_polygons, mask_polygons, road_polygons
|
||||||
|
from overview import render_map
|
||||||
|
|
||||||
SEED = 20260912
|
SEED = 20260912
|
||||||
OUT = Path(__file__).resolve().parents[2] / "public" / "data" / "vice-a"
|
OUT = Path(__file__).resolve().parents[2] / "public" / "data" / "vice-a"
|
||||||
@@ -21,6 +23,9 @@ def main() -> None:
|
|||||||
mosaic = load_mosaic(cache)
|
mosaic = load_mosaic(cache)
|
||||||
labels, unknown_share = classify(mosaic, report_unknown=True)
|
labels, unknown_share = classify(mosaic, report_unknown=True)
|
||||||
labels = drop_map_labels(labels)
|
labels = drop_map_labels(labels)
|
||||||
|
removal = remove_annotations(mosaic, labels, load_annotations(Path("data/annotations.toml")))
|
||||||
|
labels = removal.labels
|
||||||
|
print(removal.report())
|
||||||
if unknown_share > 0.05:
|
if unknown_share > 0.05:
|
||||||
raise SystemExit(f"{unknown_share:.1%} der Pixel unbekannt. Palette kalibrieren, nicht die Grenze anheben.")
|
raise SystemExit(f"{unknown_share:.1%} der Pixel unbekannt. Palette kalibrieren, nicht die Grenze anheben.")
|
||||||
shares = class_shares(labels)
|
shares = class_shares(labels)
|
||||||
@@ -62,6 +67,8 @@ def main() -> None:
|
|||||||
landmarks = json.loads(Path("data/skyline.json").read_text())["landmarks"]
|
landmarks = json.loads(Path("data/skyline.json").read_text())["landmarks"]
|
||||||
districts = json.loads(Path("data/districts.json").read_text())
|
districts = json.loads(Path("data/districts.json").read_text())
|
||||||
heights = assign_heights([p for p, _ in buildings], landmarks, districts, SEED)
|
heights = assign_heights([p for p, _ in buildings], landmarks, districts, SEED)
|
||||||
|
marked = mark_generated([p for p, _ in buildings], heights, removal.generated)
|
||||||
|
print(f"Gebäude: {len(buildings)}, davon {marked} unter entfernten Beschriftungen ergänzt")
|
||||||
palms = palm_points(sand, parks, lines, [p for p, _ in buildings], road_shapes,
|
palms = palm_points(sand, parks, lines, [p for p, _ in buildings], road_shapes,
|
||||||
land, SEED)
|
land, SEED)
|
||||||
|
|
||||||
@@ -85,6 +92,7 @@ def main() -> None:
|
|||||||
"class_shares": shares,
|
"class_shares": shares,
|
||||||
"attribution": "Kartenkacheln: GTA VI Map (CC BY 4.0) — https://map.gtadb.org, YANIS v15. Wahrzeichen: rolux/gtamaplib-vc (Unlicense).",
|
"attribution": "Kartenkacheln: GTA VI Map (CC BY 4.0) — https://map.gtadb.org, YANIS v15. Wahrzeichen: rolux/gtamaplib-vc (Unlicense).",
|
||||||
})
|
})
|
||||||
|
print(render_map(OUT, OUT), "->", OUT)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in new issue
Block a user