납품데이터셋 업로드 geojson 파일 수정
This commit is contained in:
@@ -34,6 +34,7 @@ public class DatasetBatchService {
|
||||
insertTrainTestData(map, datasetUid, type);
|
||||
} catch (Exception e) {
|
||||
log.error("파일 단위 실패. skip. file={}", batch, e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,6 +57,10 @@ public class DatasetBatchService {
|
||||
JsonNode json;
|
||||
try {
|
||||
json = parseJson(labelJson);
|
||||
if (json == null) {
|
||||
log.warn("json null. skip. file={}", labelJson);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 실패하면 skip, 다음 진행
|
||||
log.error("GeoJSON 파싱 실패. skip. file={}", geojsonPath, e);
|
||||
@@ -87,6 +92,12 @@ public class DatasetBatchService {
|
||||
// JSON 유효성 체크
|
||||
JsonNode featuresNode = json.path("features");
|
||||
|
||||
// 2. 비어있는지 확인
|
||||
if (featuresNode.isEmpty()) {
|
||||
log.warn("features empty. skip. file={}", geojsonPath);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!featuresNode.isArray()) {
|
||||
log.warn("features array 아님. skip. file={}", geojsonPath);
|
||||
return; // skip
|
||||
@@ -168,7 +179,7 @@ public class DatasetBatchService {
|
||||
return mapper.readTree(labelJson.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("label_json parse error: {}", labelJson, e);
|
||||
throw new RuntimeException("label_json parse error", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -665,7 +665,6 @@ public class DatasetService {
|
||||
i + batch.size(),
|
||||
datasetUid,
|
||||
e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user