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:
@@ -9,9 +9,9 @@ import lombok.Getter;
|
|||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum CrsType implements EnumType {
|
public enum CrsType implements EnumType {
|
||||||
EPSG_3857("korea 2000, 미터단위"),
|
EPSG_3857("Web Mercator, 웹지도 미터(EPSG:900913 동일)"),
|
||||||
EPSG_4326("geojson, osm기본"),
|
EPSG_4326("WGS84 위경도, GeoJSON/OSM 기본"),
|
||||||
EPSG_5186("google, EPSG:900913동일");
|
EPSG_5186("Korea 2000 중부 TM, 한국 SHP");
|
||||||
|
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ import lombok.Setter;
|
|||||||
|
|
||||||
public class LayerDto {
|
public class LayerDto {
|
||||||
|
|
||||||
|
public enum MapType {
|
||||||
|
CHANGE_MAP,
|
||||||
|
LABELING_MAP
|
||||||
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -259,6 +264,9 @@ public class LayerDto {
|
|||||||
@Schema(description = "rawJson")
|
@Schema(description = "rawJson")
|
||||||
private JsonNode rawJson;
|
private JsonNode rawJson;
|
||||||
|
|
||||||
|
@Schema(description = "crs")
|
||||||
|
private Integer crs;
|
||||||
|
|
||||||
public LayerMapDto(
|
public LayerMapDto(
|
||||||
String layerType,
|
String layerType,
|
||||||
String tag,
|
String tag,
|
||||||
@@ -272,7 +280,8 @@ public class LayerDto {
|
|||||||
Short maxZoom,
|
Short maxZoom,
|
||||||
String bboxGeometry,
|
String bboxGeometry,
|
||||||
UUID uuid,
|
UUID uuid,
|
||||||
String rawJsonString) {
|
String rawJsonString,
|
||||||
|
Integer crs) {
|
||||||
this.layerType = layerType;
|
this.layerType = layerType;
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
this.sortOrder = sortOrder;
|
this.sortOrder = sortOrder;
|
||||||
@@ -308,6 +317,7 @@ public class LayerDto {
|
|||||||
|
|
||||||
this.rawJson = rawJson;
|
this.rawJson = rawJson;
|
||||||
this.bbox = geoJson;
|
this.bbox = geoJson;
|
||||||
|
this.crs = crs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty("workspace")
|
@JsonProperty("workspace")
|
||||||
@@ -354,6 +364,8 @@ public class LayerDto {
|
|||||||
|
|
||||||
@JsonIgnore private String bboxGeometry;
|
@JsonIgnore private String bboxGeometry;
|
||||||
|
|
||||||
|
private Integer crs;
|
||||||
|
|
||||||
public TileUrlDto(
|
public TileUrlDto(
|
||||||
Integer mngYyyy,
|
Integer mngYyyy,
|
||||||
String url,
|
String url,
|
||||||
@@ -364,7 +376,8 @@ public class LayerDto {
|
|||||||
BigDecimal maxLat,
|
BigDecimal maxLat,
|
||||||
Short minZoom,
|
Short minZoom,
|
||||||
Short maxZoom,
|
Short maxZoom,
|
||||||
String bboxGeometry) {
|
String bboxGeometry,
|
||||||
|
Integer crs) {
|
||||||
this.mngYyyy = mngYyyy;
|
this.mngYyyy = mngYyyy;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
@@ -388,6 +401,7 @@ public class LayerDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.bbox = geoJson;
|
this.bbox = geoJson;
|
||||||
|
this.crs = crs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,15 +422,11 @@ public class LayerDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class IsMapYn {
|
public static class IsMapYn {
|
||||||
|
|
||||||
@Schema(description = "CHANGE_MAP(변화지도), LABELING_MAP(라벨링지도)", example = "CHANGE_MAP")
|
@Schema(description = "CHANGE_MAP(변화지도), LABELING_MAP(라벨링지도)", example = "CHANGE_MAP")
|
||||||
private String mapType;
|
private String mapType;
|
||||||
|
|
||||||
@Schema(description = "노출여부 true, false", example = "true")
|
@Schema(description = "노출여부 true, false", example = "true")
|
||||||
private Boolean isMapYn;
|
private Boolean isMapYn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum MapType {
|
|
||||||
CHANGE_MAP,
|
|
||||||
LABELING_MAP
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.querydsl.core.BooleanBuilder;
|
|||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
|
import com.querydsl.core.types.dsl.NumberExpression;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -92,6 +93,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LayerMapDto> findLayerMapList(String type) {
|
public List<LayerMapDto> findLayerMapList(String type) {
|
||||||
|
NumberExpression<Integer> crsInt =
|
||||||
|
Expressions.numberTemplate(
|
||||||
|
Integer.class, "cast(replace({0}, 'EPSG_', '') as integer)", mapLayerEntity.crs);
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -107,13 +112,15 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
mapLayerEntity.minZoom,
|
mapLayerEntity.minZoom,
|
||||||
mapLayerEntity.maxZoom,
|
mapLayerEntity.maxZoom,
|
||||||
Expressions.stringTemplate(
|
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.minLon,
|
||||||
mapLayerEntity.minLat,
|
mapLayerEntity.minLat,
|
||||||
mapLayerEntity.maxLon,
|
mapLayerEntity.maxLon,
|
||||||
mapLayerEntity.maxLat),
|
mapLayerEntity.maxLat,
|
||||||
|
crsInt),
|
||||||
mapLayerEntity.uuid,
|
mapLayerEntity.uuid,
|
||||||
Expressions.stringTemplate("cast({0} as text)", mapLayerEntity.rawJson)))
|
Expressions.stringTemplate("cast({0} as text)", mapLayerEntity.rawJson),
|
||||||
|
crsInt))
|
||||||
.from(mapLayerEntity)
|
.from(mapLayerEntity)
|
||||||
.where(layerTypeCondition(type), mapLayerEntity.isDeleted.isFalse())
|
.where(layerTypeCondition(type), mapLayerEntity.isDeleted.isFalse())
|
||||||
.orderBy(mapLayerEntity.order.asc())
|
.orderBy(mapLayerEntity.order.asc())
|
||||||
@@ -122,6 +129,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LayerDto.YearTileDto getChangeDetectionTileUrl(Integer beforeYear, Integer afterYear) {
|
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 =
|
LayerDto.TileUrlDto before =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
@@ -137,11 +148,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
mapSheetMngTileEntity.minZoom,
|
mapSheetMngTileEntity.minZoom,
|
||||||
mapSheetMngTileEntity.maxZoom,
|
mapSheetMngTileEntity.maxZoom,
|
||||||
Expressions.stringTemplate(
|
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.minLon,
|
||||||
mapSheetMngTileEntity.minLat,
|
mapSheetMngTileEntity.minLat,
|
||||||
mapSheetMngTileEntity.maxLon,
|
mapSheetMngTileEntity.maxLon,
|
||||||
mapSheetMngTileEntity.maxLat)))
|
mapSheetMngTileEntity.maxLat,
|
||||||
|
crsInt),
|
||||||
|
crsInt))
|
||||||
.from(mapSheetMngTileEntity)
|
.from(mapSheetMngTileEntity)
|
||||||
.where(mapSheetMngTileEntity.mngYyyy.eq(beforeYear))
|
.where(mapSheetMngTileEntity.mngYyyy.eq(beforeYear))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -161,11 +174,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
mapSheetMngTileEntity.minZoom,
|
mapSheetMngTileEntity.minZoom,
|
||||||
mapSheetMngTileEntity.maxZoom,
|
mapSheetMngTileEntity.maxZoom,
|
||||||
Expressions.stringTemplate(
|
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.minLon,
|
||||||
mapSheetMngTileEntity.minLat,
|
mapSheetMngTileEntity.minLat,
|
||||||
mapSheetMngTileEntity.maxLon,
|
mapSheetMngTileEntity.maxLon,
|
||||||
mapSheetMngTileEntity.maxLat)))
|
mapSheetMngTileEntity.maxLat,
|
||||||
|
crsInt),
|
||||||
|
crsInt))
|
||||||
.from(mapSheetMngTileEntity)
|
.from(mapSheetMngTileEntity)
|
||||||
.where(mapSheetMngTileEntity.mngYyyy.eq(afterYear))
|
.where(mapSheetMngTileEntity.mngYyyy.eq(afterYear))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -175,6 +190,10 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileUrlDto getChangeDetectionTileOneYearUrl(Integer year) {
|
public TileUrlDto getChangeDetectionTileOneYearUrl(Integer year) {
|
||||||
|
NumberExpression<Integer> crsInt =
|
||||||
|
Expressions.numberTemplate(
|
||||||
|
Integer.class, "cast(replace({0}, 'EPSG_', '') as integer)", mapSheetMngTileEntity.crs);
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -189,11 +208,13 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
mapSheetMngTileEntity.minZoom,
|
mapSheetMngTileEntity.minZoom,
|
||||||
mapSheetMngTileEntity.maxZoom,
|
mapSheetMngTileEntity.maxZoom,
|
||||||
Expressions.stringTemplate(
|
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.minLon,
|
||||||
mapSheetMngTileEntity.minLat,
|
mapSheetMngTileEntity.minLat,
|
||||||
mapSheetMngTileEntity.maxLon,
|
mapSheetMngTileEntity.maxLon,
|
||||||
mapSheetMngTileEntity.maxLat)))
|
mapSheetMngTileEntity.maxLat,
|
||||||
|
crsInt),
|
||||||
|
crsInt))
|
||||||
.from(mapSheetMngTileEntity)
|
.from(mapSheetMngTileEntity)
|
||||||
.where(mapSheetMngTileEntity.mngYyyy.eq(year))
|
.where(mapSheetMngTileEntity.mngYyyy.eq(year))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|||||||
Reference in New Issue
Block a user