feat/infer_dev_260211 #142
@@ -5,7 +5,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -170,7 +174,9 @@ public class GeoJsonValidator {
|
|||||||
// properties가 있고 scene_id가 null이 아니면 텍스트로 읽음
|
// properties가 있고 scene_id가 null이 아니면 텍스트로 읽음
|
||||||
// 없으면 null 처리
|
// 없으면 null 처리
|
||||||
String sceneId =
|
String sceneId =
|
||||||
(props != null && props.hasNonNull("scene_id")) ? props.get("scene_id").asText() : null;
|
(props != null && props.hasNonNull("scene_id"))
|
||||||
|
? props.get("scene_id").asText().trim()
|
||||||
|
: null;
|
||||||
|
|
||||||
// scene_id가 없거나 빈값이면 "정상적으로 도엽번호가 들어오지 않은 feature"로 카운트
|
// scene_id가 없거나 빈값이면 "정상적으로 도엽번호가 들어오지 않은 feature"로 카운트
|
||||||
if (sceneId == null || sceneId.isBlank()) {
|
if (sceneId == null || sceneId.isBlank()) {
|
||||||
@@ -178,6 +184,7 @@ public class GeoJsonValidator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foundUnique.add(sceneId);
|
||||||
// foundUnique.add(sceneId)가 false면 "이미 같은 값이 있었다"는 뜻 => 중복
|
// foundUnique.add(sceneId)가 false면 "이미 같은 값이 있었다"는 뜻 => 중복
|
||||||
// if (!foundUnique.add(sceneId)) {
|
// if (!foundUnique.add(sceneId)) {
|
||||||
// duplicates.add(sceneId);
|
// duplicates.add(sceneId);
|
||||||
@@ -209,17 +216,17 @@ public class GeoJsonValidator {
|
|||||||
// =========================================================
|
// =========================================================
|
||||||
log.info(
|
log.info(
|
||||||
"""
|
"""
|
||||||
===== GeoJSON Validation =====
|
===== GeoJSON Validation =====
|
||||||
file: {}
|
file: {}
|
||||||
features(total): {}
|
features(total): {}
|
||||||
requested(unique): {}
|
requested(unique): {}
|
||||||
found(unique scene_id): {}
|
found(unique scene_id): {}
|
||||||
scene_id null/blank: {}
|
scene_id null/blank: {}
|
||||||
duplicates(scene_id): {}
|
duplicates(scene_id): {}
|
||||||
missing(requested - found): {}
|
missing(requested - found): {}
|
||||||
extra(found - requested): {}
|
extra(found - requested): {}
|
||||||
==============================
|
==============================
|
||||||
""",
|
""",
|
||||||
geojsonPath,
|
geojsonPath,
|
||||||
featureCount, // 중복 포함한 전체 feature 수
|
featureCount, // 중복 포함한 전체 feature 수
|
||||||
requested.size(), // 요청 도엽 유니크 수
|
requested.size(), // 요청 도엽 유니크 수
|
||||||
@@ -233,9 +240,13 @@ public class GeoJsonValidator {
|
|||||||
// if (!duplicates.isEmpty())
|
// if (!duplicates.isEmpty())
|
||||||
// log.warn("duplicates sample: {}", duplicates.stream().limit(20).toList());
|
// log.warn("duplicates sample: {}", duplicates.stream().limit(20).toList());
|
||||||
|
|
||||||
if (!missing.isEmpty()) log.warn("missing sample: {}", missing.stream().limit(50).toList());
|
if (!missing.isEmpty()) {
|
||||||
|
log.warn("missing sample: {}", missing.stream().limit(50).toList());
|
||||||
|
}
|
||||||
|
|
||||||
if (!extra.isEmpty()) log.warn("extra sample: {}", extra.stream().limit(50).toList());
|
if (!extra.isEmpty()) {
|
||||||
|
log.warn("extra sample: {}", extra.stream().limit(50).toList());
|
||||||
|
}
|
||||||
|
|
||||||
// =========================================================
|
// =========================================================
|
||||||
// 6) 실패 조건 판정
|
// 6) 실패 조건 판정
|
||||||
|
|||||||
Reference in New Issue
Block a user