Handle citygml-tools directory outputs and doc cjio paths
This commit is contained in:
@@ -86,9 +86,22 @@ def discover_tiles(raw_dir: Path, provided: Sequence[str] | None) -> list[str]:
|
||||
return sorted(path.stem for path in raw_dir.glob("LoD2_*.gml"))
|
||||
|
||||
|
||||
def path_exists(path: Path) -> bool:
|
||||
if path.exists():
|
||||
return True
|
||||
if path.is_dir():
|
||||
return True
|
||||
# citygml-tools may output a directory named *.city.json containing a *.json
|
||||
if path.suffixes == [".city", ".json"]:
|
||||
candidate = path / f"{path.stem}.json"
|
||||
if candidate.exists():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def collect_missing(tile_ids: Sequence[str], directory: Path, pattern: str) -> list[Path]:
|
||||
expected = [directory / pattern.format(tile_id=tile_id) for tile_id in tile_ids]
|
||||
return [path for path in expected if not path.exists()]
|
||||
return [path for path in expected if not path_exists(path)]
|
||||
|
||||
|
||||
def summarize_missing(label: str, missing: list[Path]) -> str:
|
||||
|
||||
Reference in New Issue
Block a user