feat(508-2 B05 · B06 남은 셋): 3D 길 모형 D3 = 서버 — 낡은 저장본 = 옛 모형 세움(빈 3D 아님) · [3D 업데이트]만 서버 창구(/calc corridor.mesh · 같은 TS · 라이브 계획선 샘플)가 지어 바꿔 끼움 · 같은 입력 다시 안 지음 · 실패 = 옛 모형 · 늦음 남김 · 창 열 때 자동 안 지음(요구 324) · both 그대로 · 추천 창 [재계산] = 저장본 없음(409) 안내 줄 옆 · 칸 바꿈 뒤만 · 노선 편집 도엽 = 놓은 뒤(잠잠) 범위 밖이면 지금 노선 bbox 로 잘린 사본 다시 받아 바꿔 끼움(서버 bbox · 열쇠 = 사본 지문 + 범위 · 여는 때도 통째 사본 안 받음 · 배수유역 범위 그대로) · 시험 test_508_2 셋 · 낡은 기대 셋(383_3 · 309_2 · 345_4) 고침 — 요구 323
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,10 @@ logger = logging.getLogger(__name__)
|
||||
router = APIRouter(prefix="/api/projects", tags=["B04 Surface GIS"])
|
||||
tiles_router = APIRouter(tags=["B04 MVT Tiles"])
|
||||
|
||||
from B04_PreProcess.B04_PreProcess_Engine_SheetClip import clipped_sheet # noqa: E402
|
||||
from B04_PreProcess.B04_PreProcess_Engine_SheetClip import ( # noqa: E402
|
||||
clipped_sheet,
|
||||
parse_route_bbox,
|
||||
)
|
||||
|
||||
# 수치지형도 도엽 병합 레이어 (SheetParser 산출과 1:1 — 정의는 SHEET_LAYERS가 유일)
|
||||
from B04_PreProcess.B04_PreProcess_Engine_SheetParser import SHEET_LAYERS # noqa: E402
|
||||
@@ -98,13 +101,18 @@ async def get_vworld_map(
|
||||
# GeoJSON 조회 API
|
||||
@router.get("/{project_id}/geojson", response_model=None)
|
||||
async def get_project_geojson(
|
||||
project_id: UUID, layer: str, request: Request, scope: str | None = None
|
||||
project_id: UUID,
|
||||
layer: str,
|
||||
request: Request,
|
||||
scope: str | None = None,
|
||||
bbox: str | None = None,
|
||||
) -> dict[str, Any] | Response | JSONResponse:
|
||||
"""저장된 프로젝트의 특정 GeoJSON 레이어 데이터를 반환합니다.
|
||||
|
||||
도엽 레이어는 분석용 원본 대신 **표시용 사본**(프로젝트 주변만 잘라 좌표를 줄인 것)을
|
||||
파일 그대로 내보낸다. 원본을 매번 읽어 재직렬화하면 등고선 한 장에 2초가 든다.
|
||||
`scope`(route · drainage)를 주면 그 화면이 보는 범위만 자른 사본을 준다(509-1 · 509-6).
|
||||
`bbox`(route 만 · 사업지 m `x0,y0,x1,y1`) = 저장 노선 대신 편집 중 노선 bbox(508-2).
|
||||
"""
|
||||
pool = get_db_pool()
|
||||
try:
|
||||
@@ -158,7 +166,10 @@ async def get_project_geojson(
|
||||
# 그대로고 뜻 없는 자리만 사라진다.
|
||||
display = await asyncio.to_thread(_display_copy, filepath)
|
||||
if scope:
|
||||
display = await asyncio.to_thread(clipped_sheet, project_root, display, scope)
|
||||
bounds = parse_route_bbox(bbox) if scope == "route" else None
|
||||
display = await asyncio.to_thread(
|
||||
clipped_sheet, project_root, display, scope, bounds
|
||||
)
|
||||
return cached_file_response(request, display, "application/geo+json")
|
||||
|
||||
if layer == "등고선":
|
||||
|
||||
Reference in New Issue
Block a user