라벨링툴 상세 geom 리턴 형식 수정
This commit is contained in:
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.UUID;
|
||||
@@ -159,6 +160,91 @@ public class TrainingDataLabelDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "InferenceDataGeometry", description = "InferenceDataGeometry")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class InferenceDataGeometry {
|
||||
|
||||
private String type;
|
||||
@JsonIgnore private String learnGeomString;
|
||||
private JsonNode geometry;
|
||||
private InferenceProperties properties;
|
||||
|
||||
public InferenceDataGeometry(
|
||||
String type, String learnGeomString, InferenceProperties properties) {
|
||||
this.type = type;
|
||||
this.properties = properties;
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode inferenceJson;
|
||||
try {
|
||||
inferenceJson = mapper.readTree(learnGeomString);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.geometry = inferenceJson;
|
||||
|
||||
if (inferenceJson.isObject()) {
|
||||
((ObjectNode) inferenceJson).remove("crs");
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class InferenceProperties {
|
||||
|
||||
@Schema(description = "beforeClass", example = "WASTE")
|
||||
private String beforeClass;
|
||||
|
||||
@Schema(description = "afterClass", example = "LAND")
|
||||
private String afterClass;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "LearnDataGeometry", description = "LearnDataGeometry")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class LearnDataGeometry {
|
||||
|
||||
private String type;
|
||||
@JsonIgnore private String learnGeomString;
|
||||
private JsonNode geometry;
|
||||
private LearnProperties properties;
|
||||
|
||||
public LearnDataGeometry(String type, String learnGeomString, LearnProperties properties) {
|
||||
this.type = type;
|
||||
this.properties = properties;
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode learnJson;
|
||||
try {
|
||||
learnJson = mapper.readTree(learnGeomString);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.geometry = learnJson;
|
||||
|
||||
if (learnJson.isObject()) {
|
||||
((ObjectNode) learnJson).remove("crs");
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class LearnProperties {
|
||||
|
||||
@Schema(description = "beforeClass", example = "WASTE")
|
||||
private String beforeClass;
|
||||
|
||||
@Schema(description = "afterClass", example = "LAND")
|
||||
private String afterClass;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "searchReq", description = "검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -201,7 +287,7 @@ public class TrainingDataLabelDto {
|
||||
private InspectionResultInfo inspectionResultInfo;
|
||||
|
||||
@Schema(description = "Geometry (GeoJSON)")
|
||||
private JsonNode geom;
|
||||
private InferenceDataGeometry geom;
|
||||
|
||||
@Schema(description = "변화 전 COG 이미지 URL")
|
||||
private String beforeCogUrl;
|
||||
@@ -213,7 +299,7 @@ public class TrainingDataLabelDto {
|
||||
private JsonNode mapBox;
|
||||
|
||||
@Schema(description = "라벨링 툴에서 그린 폴리곤")
|
||||
private JsonNode learnGeometry;
|
||||
private LearnDataGeometry learnGeometry;
|
||||
}
|
||||
|
||||
@Schema(name = "ChangeDetectionInfo", description = "변화탐지정보")
|
||||
|
||||
Reference in New Issue
Block a user