perf(전처리): 343-1 같은 지형 파일 다시 올림 = 전처리 결과 살림 · 다시 돌 때 점군 안 풂 · 도엽 병합 · 국가 GIS · 타일 기억 열쇠

- B03 재올림 — 지형 파일이 source_identity.json 과 같으면 B04 폴더 · 지표면 DB 행 남기고 단계 표시만 되돌림
- 확인 창 「처음부터 다시」 따로 고름(fresh_start) · 409 응답에 preprocess_kept
- B04 다시 돎 — 점 수 · 평균 Z 를 structured_stats.json 에 · xyz 는 쓸 때만 풂
- 도엽 병합 열쇠 = 도엽 번호 목록 · 국가 GIS 열쇠 = 범위 · 좌표계
- 지도 타일 메모리 기억 열쇠에 mtime · 크기
- 시험 test_343_1_preprocess_keep 13건

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
This commit is contained in:
2026-10-16 11:00:04 +09:00
co-authored by Claude Opus 5.5
parent 2879f9bea9
commit cf5de56418
9 changed files with 449 additions and 31 deletions
+10 -1
View File
@@ -57,11 +57,14 @@ export interface UploadStatusResponse {
*/
export class ReplaceOutputsConfirmRequired extends Error {
readonly targets: string[];
/** 지형 파일이 그대로라 전처리 결과를 살리는지 — 「처음부터 다시」를 따로 묻는다. */
readonly preprocessKept: boolean;
constructor(message: string, targets: string[]) {
constructor(message: string, targets: string[], preprocessKept = false) {
super(message);
this.name = "ReplaceOutputsConfirmRequired";
this.targets = targets;
this.preprocessKept = preprocessKept;
}
}
@@ -70,12 +73,14 @@ async function readJsonOrThrow<T>(response: Response): Promise<T> {
message?: string;
confirm?: string;
targets?: string[];
preprocess_kept?: boolean;
};
if (!response.ok) {
if (response.status === 409 && payload.confirm === "replace_outputs") {
throw new ReplaceOutputsConfirmRequired(
payload.message ?? "이미 만들어 둔 결과가 지워집니다.",
payload.targets ?? [],
payload.preprocess_kept === true,
);
}
throw new Error(payload.message ?? `HTTP ${response.status}`);
@@ -115,6 +120,7 @@ export async function createUploadSession(
completeUpload = false,
lasFree = false,
confirmReplace = false,
freshStart = false,
): Promise<ChunkSessionCreateResponse> {
const response = await fetch(`${API_BASE_URL}/projects/${projectId}/upload-sessions`, {
method: "POST",
@@ -128,6 +134,7 @@ export async function createUploadSession(
complete_upload: completeUpload,
las_free: lasFree,
confirm_replace: confirmReplace,
fresh_start: freshStart,
}),
});
return await readJsonOrThrow<ChunkSessionCreateResponse>(response);
@@ -160,6 +167,7 @@ export async function finalizeUploadSession(
fingerprint?: string | null,
lasFree = false,
confirmReplace = false,
freshStart = false,
): Promise<FileUploadResponse> {
const response = await fetch(`${API_BASE_URL}/projects/${projectId}/finalize`, {
method: "POST",
@@ -172,6 +180,7 @@ export async function finalizeUploadSession(
fingerprint: fingerprint ?? null,
las_free: lasFree,
confirm_replace: confirmReplace,
fresh_start: freshStart,
}),
});
return await readJsonOrThrow<FileUploadResponse>(response);