변화탐지 API 커밋, 에러로그 진행중

This commit is contained in:
2025-11-28 18:05:36 +09:00
parent 9a06955e32
commit 55564cfce6
11 changed files with 259 additions and 73 deletions

View File

@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
@Tag(name = "변화탐지", description = "변화탐지 API")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/change-detection")
@RequestMapping({"/api/change-detection", "/demo/api/change-detection"})
@Transactional
public class ChangeDetectionApiController {
@@ -41,11 +41,12 @@ public class ChangeDetectionApiController {
}
@Operation(summary = "변화탐지 분류별 건수", description = "변화탐지 분류별 건수")
@GetMapping("/class-count/{id}")
@GetMapping("/class-count")
public ApiResponseDto<List<ChangeDetectionDto.CountDto>> getChangeDetectionClassCount(
@Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "1") @PathVariable
Long id) {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id));
@Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "1") @RequestParam
Long id,
@Parameter(description = "탐지된 도엽번호", example = "34602060") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id, mapSheetNum));
}
@Operation(summary = "변화탐지 COG Url", description = "변화탐지 COG Url")
@@ -64,4 +65,29 @@ public class ChangeDetectionApiController {
public ApiResponseDto<List<ChangeDetectionDto.AnalYearList>> getChangeDetectionYearList() {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionYearList());
}
@Operation(summary = "변화탐지 탐지된 도엽 목록", description = "변화탐지 탐지된 도엽 목록")
@GetMapping("/map-list")
public ApiResponseDto<List<ChangeDetectionDto.MapSheetList>> getChangeDetectionMapSheetList(
@Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid) {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionMapSheetList(analUid));
}
@Operation(summary = "변화탐지 결과 Polygon", description = "변화탐지 결과 Polygon")
@GetMapping("/polygon")
public ApiResponseDto<List<ChangeDetectionDto.PolygonGeometry>> getChangeDetectionPolygonList(
@Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid,
@Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok(
changeDetectionService.getChangeDetectionPolygonList(analUid, mapSheetNum));
}
@Operation(summary = "변화탐지 결과 Point", description = "변화탐지 결과 Point")
@GetMapping("/point")
public ApiResponseDto<List<ChangeDetectionDto.PointGeometry>> getChangeDetectionPointList(
@Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid,
@Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok(
changeDetectionService.getChangeDetectionPointList(analUid, mapSheetNum));
}
}

View File

@@ -18,7 +18,6 @@ public class ChangeDetectionDto {
private Long id;
private Geometry polygon;
private Double centroidX;
;
private Double centroidY;
}
@@ -68,6 +67,17 @@ public class ChangeDetectionDto {
private String baseMapSheetNum;
}
@Schema(name = "MapSheetList", description = "년도에 해당하는 도엽 목록")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class MapSheetList {
private String mapSheetNum;
private String mapSheetName;
private String alias;
}
@Schema(name = "PolygonGeometry", description = "폴리곤 리턴 객체")
@Getter
@Setter
@@ -75,37 +85,30 @@ public class ChangeDetectionDto {
@AllArgsConstructor
public static class PointGeometry {
private Long geoUid;
private String type; // "Point"
private Geometry coordinates; // Point 값
private String before_class; // 기준 분류
private String after_class; // 비교 분류
private Geometry geometry; // Point
private String classCd; // after 분류
}
@Schema(name = "PolygonGeometry", description = "폴리곤 리턴 객체")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class PolygonGeometry {
private Long geoUid;
private String type; // "MultiPolygon"
private Geometry coordinates; // Polygon 값
private Double center_latitude; // 폴리곤 중심 위도
private Double center_longitude; // 폴리곤 중심 경도
private Geometry geometry; // Polygon
private PolygonProperties properties;
}
@Schema(name = "PolygonProperties", description = "폴리곤 정보")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class PolygonProperties {
private Double area; // 면적
private String before_year; // 기준년도
private Double before_confidence; // 기준 신뢰도(확률)
private String before_class; // 기준 분류
private String after_year; // 비교년도
private Double after_confidence; // 비교 신뢰도(확률)
private String after_class; // 비교 분류
private Integer beforeYear; // 기준년도
private Double beforeConfidence; // 기준 신뢰도(확률)
private String beforeClass; // 기준 분류
private Integer afterYear; // 비교년도
private Double afterConfidence; // 비교 신뢰도(확률)
private String afterClass; // 비교 분류
}
}

View File

@@ -21,8 +21,9 @@ public class ChangeDetectionService {
return changeDetectionCoreService.getPolygonToJson();
}
public List<ChangeDetectionDto.CountDto> getChangeDetectionClassCount(Long id) {
return changeDetectionCoreService.getChangeDetectionClassCount(id);
public List<ChangeDetectionDto.CountDto> getChangeDetectionClassCount(
Long id, String mapSheetNum) {
return changeDetectionCoreService.getChangeDetectionClassCount(id, mapSheetNum);
}
public ChangeDetectionDto.CogUrlDto getChangeDetectionCogUrl(ChangeDetectionDto.CogUrlReq req) {
@@ -32,4 +33,18 @@ public class ChangeDetectionService {
public List<ChangeDetectionDto.AnalYearList> getChangeDetectionYearList() {
return changeDetectionCoreService.getChangeDetectionYearList();
}
public List<ChangeDetectionDto.PolygonGeometry> getChangeDetectionPolygonList(
Long analUid, String mapSheetNum) {
return changeDetectionCoreService.getChangeDetectionPolygonList(analUid, mapSheetNum);
}
public List<ChangeDetectionDto.PointGeometry> getChangeDetectionPointList(
Long analUid, String mapSheetNum) {
return changeDetectionCoreService.getChangeDetectionPointList(analUid, mapSheetNum);
}
public List<ChangeDetectionDto.MapSheetList> getChangeDetectionMapSheetList(Long analUid) {
return changeDetectionCoreService.getChangeDetectionMapSheetList(analUid);
}
}