납품데이터셋 업로드 geojson 파일 수정

This commit is contained in:
2026-03-27 10:56:38 +09:00
parent f4a81a34d6
commit 8698bf61d1
2 changed files with 12 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ public class DatasetBatchService {
insertTrainTestData(map, datasetUid, type); insertTrainTestData(map, datasetUid, type);
} catch (Exception e) { } catch (Exception e) {
log.error("파일 단위 실패. skip. file={}", batch, e); log.error("파일 단위 실패. skip. file={}", batch, e);
continue;
} }
} }
} }
@@ -56,6 +57,10 @@ public class DatasetBatchService {
JsonNode json; JsonNode json;
try { try {
json = parseJson(labelJson); json = parseJson(labelJson);
if (json == null) {
log.warn("json null. skip. file={}", labelJson);
return;
}
} catch (Exception e) { } catch (Exception e) {
// 실패하면 skip, 다음 진행 // 실패하면 skip, 다음 진행
log.error("GeoJSON 파싱 실패. skip. file={}", geojsonPath, e); log.error("GeoJSON 파싱 실패. skip. file={}", geojsonPath, e);
@@ -87,6 +92,12 @@ public class DatasetBatchService {
// JSON 유효성 체크 // JSON 유효성 체크
JsonNode featuresNode = json.path("features"); JsonNode featuresNode = json.path("features");
// 2. 비어있는지 확인
if (featuresNode.isEmpty()) {
log.warn("features empty. skip. file={}", geojsonPath);
return;
}
if (!featuresNode.isArray()) { if (!featuresNode.isArray()) {
log.warn("features array 아님. skip. file={}", geojsonPath); log.warn("features array 아님. skip. file={}", geojsonPath);
return; // skip return; // skip
@@ -168,7 +179,7 @@ public class DatasetBatchService {
return mapper.readTree(labelJson.toString()); return mapper.readTree(labelJson.toString());
} catch (Exception e) { } catch (Exception e) {
log.error("label_json parse error: {}", labelJson, e); log.error("label_json parse error: {}", labelJson, e);
throw new RuntimeException("label_json parse error", e); return null;
} }
} }

View File

@@ -665,7 +665,6 @@ public class DatasetService {
i + batch.size(), i + batch.size(),
datasetUid, datasetUid,
e); e);
throw e;
} }
} }