년도별 타일 API

This commit is contained in:
2026-01-30 11:04:14 +09:00
parent ceebbdfa50
commit babf35142a
6 changed files with 159 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import com.kamco.cd.kamcoback.layer.dto.LayerDto.OrderReq;
import com.kamco.cd.kamcoback.layer.dto.LayerDto.SearchReq;
import com.kamco.cd.kamcoback.layer.service.LayerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -224,4 +225,12 @@ public class LayerApiController {
public ApiResponseDto<List<LayerMapDto>> labelingMap() {
return ApiResponseDto.ok(layerService.findLayerMapList("labeling"));
}
@Operation(summary = "년도별 tile Url", description = "년도별 tile Url")
@GetMapping("/tile-url")
public ApiResponseDto<LayerDto.YearTileDto> getChangeDetectionTileUrl(
@Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear,
@Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear) {
return ApiResponseDto.ok(layerService.getChangeDetectionTileUrl(beforeYear, afterYear));
}
}

View File

@@ -303,4 +303,90 @@ public class LayerDto {
this.bbox = geoJson;
}
}
@Schema(name = "TileUrlDto", description = "Tile Url 정보")
@Getter
@Setter
@NoArgsConstructor
public static class TileUrlDto {
@Schema(description = "mngYyyy")
private Integer mngYyyy;
@Schema(description = "url")
private String url;
@Schema(description = "태그")
private String tag;
@Schema(description = "좌측상단 경도", example = "126.0")
private BigDecimal minLon;
@Schema(description = "좌측상단 위도", example = "34.0")
private BigDecimal minLat;
@Schema(description = "우측하단 경도", example = "130.0")
private BigDecimal maxLon;
@Schema(description = "우측하단 위도", example = "38.5")
private BigDecimal maxLat;
@Schema(description = "zoom min", example = "5")
private Short minZoom;
@Schema(description = "zoom max", example = "18")
private Short maxZoom;
@Schema(description = "bbox")
private JsonNode bbox;
@JsonIgnore private String bboxGeometry;
public TileUrlDto(
Integer mngYyyy,
String url,
String tag,
BigDecimal minLon,
BigDecimal minLat,
BigDecimal maxLon,
BigDecimal maxLat,
Short minZoom,
Short maxZoom,
String bboxGeometry) {
this.mngYyyy = mngYyyy;
this.url = url;
this.tag = tag;
this.minLon = minLon;
this.minLat = minLat;
this.maxLon = maxLon;
this.maxLat = maxLat;
this.minZoom = minZoom;
this.maxZoom = maxZoom;
this.bboxGeometry = bboxGeometry;
JsonNode geoJson = null;
if (bboxGeometry != null) {
ObjectMapper mapper = new ObjectMapper();
try {
geoJson = mapper.readTree(bboxGeometry);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
this.bbox = geoJson;
}
}
@Schema(name = "TileUrlDto", description = "Tile Url 정보")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class YearTileDto {
private TileUrlDto before;
private TileUrlDto after;
}
}

View File

@@ -164,4 +164,8 @@ public class LayerService {
public List<LayerMapDto> findLayerMapList(String type) {
return mapLayerCoreService.findLayerMapList(type);
}
public LayerDto.YearTileDto getChangeDetectionTileUrl(Integer beforeYear, Integer afterYear) {
return mapLayerCoreService.getChangeDetectionTileUrl(beforeYear, afterYear);
}
}