- 폴더·내부 파일 51개 접두사 개명 (git mv, 이력 보존) - 저장소 전체 참조 치환 67파일: import 경로, 라우트 슬러그(b04-preprocess), 라우트 키(B04_PREPROCESS), storage 경로 상수, locale, SQL 주석 - 로직 변경 없음 (기계적 치환). typecheck·백엔드 import 검증 통과 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
57 lines
1.8 KiB
Python
57 lines
1.8 KiB
Python
import sys
|
|
import traceback
|
|
from pathlib import Path
|
|
import numpy as np
|
|
|
|
# Add project root to sys.path
|
|
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
|
sys.path.insert(0, str(PROJECT_ROOT))
|
|
|
|
from B04_PreProcess.B04_PreProcess_Engine_VWorld import download_vworld_satellite_map
|
|
from B04_PreProcess.B04_PreProcess_Engine_GisVector import download_all_gis_vectors
|
|
|
|
PRJ_PATH = PROJECT_ROOT / "storage/1/3/acb9170b-9ac8-49b3-82a0-51cfa32bb42d/B03_FileInput/input/prj/result.prj"
|
|
NPZ_PATH = PROJECT_ROOT / "storage/1/3/acb9170b-9ac8-49b3-82a0-51cfa32bb42d/B04_PreProcess/processed/ground_points_csf.npz"
|
|
OUTPUT_DIR = PROJECT_ROOT / "storage/1/3/acb9170b-9ac8-49b3-82a0-51cfa32bb42d/B04_PreProcess/processed"
|
|
|
|
def main():
|
|
print("Loading NPZ to get bounds...")
|
|
with np.load(NPZ_PATH) as data:
|
|
bounds = data["bounds"]
|
|
print("Raw bounds:", bounds)
|
|
|
|
bounds_dict = {
|
|
"x": [float(bounds[0, 0]), float(bounds[0, 1])],
|
|
"y": [float(bounds[1, 0]), float(bounds[1, 1])],
|
|
"z": [float(bounds[2, 0]), float(bounds[2, 1])],
|
|
}
|
|
|
|
print("\n--- Test 1: VWorld Satellite Map Download ---")
|
|
try:
|
|
res = download_vworld_satellite_map(
|
|
prj_path=PRJ_PATH,
|
|
bounds=bounds_dict,
|
|
output_dir=OUTPUT_DIR,
|
|
layer_name="Satellite",
|
|
ext="jpeg"
|
|
)
|
|
print("Download Result:", res)
|
|
except Exception as e:
|
|
print("VWorld Download Failed:")
|
|
traceback.print_exc()
|
|
|
|
print("\n--- Test 2: GIS Vector Download ---")
|
|
try:
|
|
download_all_gis_vectors(
|
|
prj_path=PRJ_PATH,
|
|
bounds_meter=bounds_dict,
|
|
output_dir=OUTPUT_DIR
|
|
)
|
|
print("GIS Vector Download completed.")
|
|
except Exception as e:
|
|
print("GIS Download Failed:")
|
|
traceback.print_exc()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|