Merge pull request 'feat/infer_dev_260107' (#31) from feat/infer_dev_260107 into develop

Reviewed-on: #31
This commit was merged in pull request #31.
This commit is contained in:
2026-01-30 21:32:17 +09:00
3 changed files with 50 additions and 19 deletions

View File

@@ -9,9 +9,9 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum CrsType implements EnumType {
EPSG_3857("korea 2000, 미터단위"),
EPSG_4326("geojson, osm기본"),
EPSG_5186("google, EPSG:900913동일");
EPSG_3857("Web Mercator, 웹지도 미터(EPSG:900913 동일)"),
EPSG_4326("WGS84 위경도, GeoJSON/OSM 기본"),
EPSG_5186("Korea 2000 중부 TM, 한국 SHP");
private final String desc;

View File

@@ -17,6 +17,11 @@ import lombok.Setter;
public class LayerDto {
public enum MapType {
CHANGE_MAP,
LABELING_MAP
}
@Getter
@Setter
@AllArgsConstructor
@@ -259,6 +264,9 @@ public class LayerDto {
@Schema(description = "rawJson")
private JsonNode rawJson;
@Schema(description = "crs")
private Integer crs;
public LayerMapDto(
String layerType,
String tag,
@@ -272,7 +280,8 @@ public class LayerDto {
Short maxZoom,
String bboxGeometry,
UUID uuid,
String rawJsonString) {
String rawJsonString,
Integer crs) {
this.layerType = layerType;
this.tag = tag;
this.sortOrder = sortOrder;
@@ -308,6 +317,7 @@ public class LayerDto {
this.rawJson = rawJson;
this.bbox = geoJson;
this.crs = crs;
}
@JsonProperty("workspace")
@@ -354,6 +364,8 @@ public class LayerDto {
@JsonIgnore private String bboxGeometry;
private Integer crs;
public TileUrlDto(
Integer mngYyyy,
String url,
@@ -364,7 +376,8 @@ public class LayerDto {
BigDecimal maxLat,
Short minZoom,
Short maxZoom,
String bboxGeometry) {
String bboxGeometry,
Integer crs) {
this.mngYyyy = mngYyyy;
this.url = url;
this.tag = tag;
@@ -388,6 +401,7 @@ public class LayerDto {
}
this.bbox = geoJson;
this.crs = crs;
}
}
@@ -408,15 +422,11 @@ public class LayerDto {
@NoArgsConstructor
@AllArgsConstructor
public static class IsMapYn {
@Schema(description = "CHANGE_MAP(변화지도), LABELING_MAP(라벨링지도)", example = "CHANGE_MAP")
private String mapType;
@Schema(description = "노출여부 true, false", example = "true")
private Boolean isMapYn;
}
public enum MapType {
CHANGE_MAP,
LABELING_MAP
}
}

View File

@@ -11,6 +11,7 @@ import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.NumberExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.Collection;
import java.util.List;
@@ -92,6 +93,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
@Override
public List<LayerMapDto> findLayerMapList(String type) {
NumberExpression<Integer> crsInt =
Expressions.numberTemplate(
Integer.class, "cast(replace({0}, 'EPSG_', '') as integer)", mapLayerEntity.crs);
return queryFactory
.select(
Projections.constructor(
@@ -107,13 +112,15 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
mapLayerEntity.minZoom,
mapLayerEntity.maxZoom,
Expressions.stringTemplate(
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), 5186))",
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), {4}))",
mapLayerEntity.minLon,
mapLayerEntity.minLat,
mapLayerEntity.maxLon,
mapLayerEntity.maxLat),
mapLayerEntity.maxLat,
crsInt),
mapLayerEntity.uuid,
Expressions.stringTemplate("cast({0} as text)", mapLayerEntity.rawJson)))
Expressions.stringTemplate("cast({0} as text)", mapLayerEntity.rawJson),
crsInt))
.from(mapLayerEntity)
.where(layerTypeCondition(type), mapLayerEntity.isDeleted.isFalse())
.orderBy(mapLayerEntity.order.asc())
@@ -122,6 +129,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
@Override
public LayerDto.YearTileDto getChangeDetectionTileUrl(Integer beforeYear, Integer afterYear) {
NumberExpression<Integer> crsInt =
Expressions.numberTemplate(
Integer.class, "cast(replace({0}, 'EPSG_', '') as integer)", mapSheetMngTileEntity.crs);
LayerDto.TileUrlDto before =
queryFactory
.select(
@@ -137,11 +148,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
mapSheetMngTileEntity.minZoom,
mapSheetMngTileEntity.maxZoom,
Expressions.stringTemplate(
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), 5186))",
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), {4}))",
mapSheetMngTileEntity.minLon,
mapSheetMngTileEntity.minLat,
mapSheetMngTileEntity.maxLon,
mapSheetMngTileEntity.maxLat)))
mapSheetMngTileEntity.maxLat,
crsInt),
crsInt))
.from(mapSheetMngTileEntity)
.where(mapSheetMngTileEntity.mngYyyy.eq(beforeYear))
.fetchOne();
@@ -161,11 +174,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
mapSheetMngTileEntity.minZoom,
mapSheetMngTileEntity.maxZoom,
Expressions.stringTemplate(
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), 5186))",
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), {4}))",
mapSheetMngTileEntity.minLon,
mapSheetMngTileEntity.minLat,
mapSheetMngTileEntity.maxLon,
mapSheetMngTileEntity.maxLat)))
mapSheetMngTileEntity.maxLat,
crsInt),
crsInt))
.from(mapSheetMngTileEntity)
.where(mapSheetMngTileEntity.mngYyyy.eq(afterYear))
.fetchOne();
@@ -175,6 +190,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
@Override
public TileUrlDto getChangeDetectionTileOneYearUrl(Integer year) {
NumberExpression<Integer> crsInt =
Expressions.numberTemplate(
Integer.class, "cast(replace({0}, 'EPSG_', '') as integer)", mapSheetMngTileEntity.crs);
return queryFactory
.select(
Projections.constructor(
@@ -189,11 +208,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
mapSheetMngTileEntity.minZoom,
mapSheetMngTileEntity.maxZoom,
Expressions.stringTemplate(
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), 5186))",
"ST_AsGeoJSON(ST_Transform(ST_MakeEnvelope({0}, {1}, {2}, {3}, 4326), {4}))",
mapSheetMngTileEntity.minLon,
mapSheetMngTileEntity.minLat,
mapSheetMngTileEntity.maxLon,
mapSheetMngTileEntity.maxLat)))
mapSheetMngTileEntity.maxLat,
crsInt),
crsInt))
.from(mapSheetMngTileEntity)
.where(mapSheetMngTileEntity.mngYyyy.eq(year))
.fetchOne();