feat(D 예정노선): 도엽 조각 — 공용 창고 storage/_shared/sheets · 보이는 도엽만 받기 (PLAN 606-1 · 606-2 · 요구 477)
- 새 D03_PlanAnalysis_SheetTiles.py — 도엽 도곽으로 자른 선 겹 조각(등고 · 계곡 = 전국 등고선 · 세류 · 물 면 · 도로 · 건물 · 지명 = 도엽 zip) · zip 은 프로젝트 · 공용 지형 창고에서 복사(원본 안 지움) 뒤 받기 · 빈 도엽 = 빈 조각 · 받기 실패 저장 안 함 · B04 함수 부르기만 - 라우터 길 둘 — 보이는 도엽 목록(bbox) · 조각 하나 - 새 UI_SheetTiles.ts — 보기 멈춘 뒤 보이는 도엽 · 없는 조각만 하나씩 · 12 장 이하 다 · 13~30 계곡선만 · 넘음 숨김 · 서클 - UI_Layers — 도엽 선 겹 원천을 조각으로 · 시험 606 새 · 475 옛 겹 길 단언 바꿈 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
`…/zones` · `…/soils` · `…/bands` · `…/lines?kind=` · `…/zero-order` ·
|
||||
`…/forest-roads`(GET · POST 올리기 · `/bundles` 목록 · DELETE `/<번호>`) ·
|
||||
`…/landslide-zones` — 지도 겹 (PLAN 569-1 · 581-1 · 581-2 · 584-1 · 584-3 · 605-1)
|
||||
- `GET …/plan/sheet-tiles?bbox=` · `…/sheet-tiles/{도엽}/{겹}` — 보이는 도엽 · 도엽 조각(606)
|
||||
|
||||
범위 = 기준점 둘레(`SITE_RADIUS_M`) + 지점 + 그은 점(`extra` · 지도 보기 귀) 상자 + 여유 ∪ 받은 범위
|
||||
(PLAN 591-2 · 기준점 = 처음 받는 기준일 뿐).
|
||||
@@ -42,6 +43,7 @@ from D03_PlanAnalysis import D03_PlanAnalysis_Landslide as landslide
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_LandslideZone as landslide_zone
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_Layers as layers
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_Network as network
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_SheetTiles as sheet_tiles
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_Store as store
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_Terrain as terrain
|
||||
from D03_PlanAnalysis import D03_PlanAnalysis_ZeroOrder as zero_order
|
||||
@@ -346,6 +348,31 @@ async def plan_layer_sheet(project_id: UUID, key: str, request: Request) -> Resp
|
||||
return cached_file_response(request, clipped, "application/geo+json")
|
||||
|
||||
|
||||
@router.get("/{project_id}/plan/sheet-tiles", response_model=None)
|
||||
async def plan_sheet_tiles(project_id: UUID, bbox: str) -> dict[str, Any]:
|
||||
"""보이는 도엽(606-2) — 지도 보기 경위도 상자 → 수 · 번호(가운데부터 · 30 장 넘음 = 없음)."""
|
||||
try:
|
||||
lon0, lat0, lon1, lat1 = (float(v) for v in bbox.split(","))
|
||||
except ValueError as error:
|
||||
raise HTTPException(status_code=400, detail="bbox = 경도,위도,경도,위도") from error
|
||||
if not (120 < lon0 < 135 and 120 < lon1 < 135 and 30 < lat0 < 45 and 30 < lat1 < 45):
|
||||
raise HTTPException(status_code=400, detail="국내 경위도가 아닙니다.")
|
||||
count, sheets = sheet_tiles.sheets_in_box((lon0, lat0, lon1, lat1))
|
||||
return {"count": count, "sheets": sheets}
|
||||
|
||||
|
||||
@router.get("/{project_id}/plan/sheet-tiles/{sheet_no}/{name}", response_model=None)
|
||||
async def plan_sheet_tile(project_id: UUID, sheet_no: str, name: str, request: Request) -> Response:
|
||||
"""도엽 조각 하나(606-1) — 공용 창고 · 없으면 만듦(등고 = 전국 파일 · 그 밖 = 도엽 zip)."""
|
||||
try:
|
||||
path = await asyncio.to_thread(sheet_tiles.ensure_tile, sheet_no, name)
|
||||
except KeyError as error:
|
||||
raise HTTPException(status_code=400, detail=f"없는 도엽 조각: {error}") from error
|
||||
except RuntimeError as error:
|
||||
raise HTTPException(status_code=502, detail=str(error)) from error
|
||||
return cached_file_response(request, path, "application/geo+json")
|
||||
|
||||
|
||||
@router.get("/{project_id}/plan/layers/cadastral", response_model=None)
|
||||
async def plan_layer_cadastral(project_id: UUID, request: Request) -> Response:
|
||||
"""지적도 GeoJSON(브이월드 LX맵 · 참고용) — 받은 범위를 덮지 않으면 지금 받음."""
|
||||
|
||||
Reference in New Issue
Block a user