Geojson Polygon DATA Operating System Build Complete - Daniel C No.5
This commit is contained in:
@@ -7,13 +7,12 @@ import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "변화탐지", description = "변화탐지 API")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@@ -32,10 +31,11 @@ public class ChangeDetectionApiController {
|
||||
|
||||
/**
|
||||
* PolygonData -> JsonNode 변환 예제
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/json-data")
|
||||
public ApiResponseDto<List<JsonNode>> getPolygonToJson(){
|
||||
public ApiResponseDto<List<JsonNode>> getPolygonToJson() {
|
||||
return ApiResponseDto.ok(changeDetectionService.getPolygonToJson());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
|
||||
public class ChangeDetectionDto{
|
||||
public class ChangeDetectionDto {
|
||||
|
||||
@Schema(name = "TestDto", description = "테스트용")
|
||||
@Getter
|
||||
@@ -17,7 +17,8 @@ public class ChangeDetectionDto{
|
||||
public static class TestDto {
|
||||
private Long id;
|
||||
private Geometry polygon;
|
||||
private Double centroidX;;
|
||||
private Double centroidX;
|
||||
;
|
||||
private Double centroidY;
|
||||
}
|
||||
|
||||
@@ -26,12 +27,12 @@ public class ChangeDetectionDto{
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PointGeometry{
|
||||
public static class PointGeometry {
|
||||
private Long geoUid;
|
||||
private String type; // "Point"
|
||||
private Geometry coordinates; //Point 값
|
||||
private String before_class; //기준 분류
|
||||
private String after_class; //비교 분류
|
||||
private String type; // "Point"
|
||||
private Geometry coordinates; // Point 값
|
||||
private String before_class; // 기준 분류
|
||||
private String after_class; // 비교 분류
|
||||
}
|
||||
|
||||
@Schema(name = "PolygonGeometry", description = "폴리곤 리턴 객체")
|
||||
@@ -39,12 +40,12 @@ public class ChangeDetectionDto{
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class PolygonGeometry{
|
||||
public static class PolygonGeometry {
|
||||
private Long geoUid;
|
||||
private String type; // "MultiPolygon"
|
||||
private Geometry coordinates; //Polygon 값
|
||||
private Double center_latitude; //폴리곤 중심 위도
|
||||
private Double center_longitude; //폴리곤 중심 경도
|
||||
private String type; // "MultiPolygon"
|
||||
private Geometry coordinates; // Polygon 값
|
||||
private Double center_latitude; // 폴리곤 중심 위도
|
||||
private Double center_longitude; // 폴리곤 중심 경도
|
||||
}
|
||||
|
||||
@Schema(name = "CogURL", description = "COG URL")
|
||||
@@ -52,9 +53,9 @@ public class ChangeDetectionDto{
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogURL{
|
||||
private String before_cog_url; //기준 COG URL
|
||||
private String after_cog_url; //비교 COG URL
|
||||
public static class CogURL {
|
||||
private String before_cog_url; // 기준 COG URL
|
||||
private String after_cog_url; // 비교 COG URL
|
||||
}
|
||||
|
||||
@Schema(name = "PolygonProperties", description = "폴리곤 정보")
|
||||
@@ -62,13 +63,13 @@ public class ChangeDetectionDto{
|
||||
@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; //비교 분류
|
||||
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; // 비교 분류
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ChangeDetectionService {
|
||||
return changeDetectionCoreService.getPolygonToPoint();
|
||||
}
|
||||
|
||||
public List<JsonNode> getPolygonToJson(){
|
||||
public List<JsonNode> getPolygonToJson() {
|
||||
return changeDetectionCoreService.getPolygonToJson();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user