라벨링 툴 라벨러 목록에 polygon, cog 추가
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.trainingdata;
|
package com.kamco.cd.kamcoback.postgres.repository.trainingdata;
|
||||||
|
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QImageryEntity.imageryEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
@@ -8,6 +9,10 @@ import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
|||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingListDto;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingListDto;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.searchReq;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.searchReq;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
|
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||||
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
|
import com.querydsl.core.types.dsl.NumberPath;
|
||||||
|
import com.querydsl.core.types.dsl.StringExpression;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@@ -40,7 +45,15 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
labelingAssignmentEntity.workState,
|
labelingAssignmentEntity.workState,
|
||||||
labelingAssignmentEntity.assignGroupId,
|
labelingAssignmentEntity.assignGroupId,
|
||||||
mapInkx5kEntity.mapidNm,
|
mapInkx5kEntity.mapidNm,
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu))
|
mapSheetAnalDataInferenceGeomEntity.pnu,
|
||||||
|
Expressions.stringTemplate(
|
||||||
|
"ST_AsGeoJSON({0})", mapSheetAnalDataInferenceGeomEntity.geom),
|
||||||
|
makeCogUrl(mapSheetAnalDataInferenceGeomEntity.compareYyyy)
|
||||||
|
.max()
|
||||||
|
.as("beforeCogUrl"),
|
||||||
|
makeCogUrl(mapSheetAnalDataInferenceGeomEntity.targetYyyy)
|
||||||
|
.max()
|
||||||
|
.as("afterCogUrl")))
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
@@ -48,7 +61,28 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntity.geoUid))
|
mapSheetAnalDataInferenceGeomEntity.geoUid))
|
||||||
.innerJoin(mapInkx5kEntity)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
|
.leftJoin(imageryEntity)
|
||||||
|
.on(
|
||||||
|
imageryEntity
|
||||||
|
.scene5k
|
||||||
|
.eq(labelingAssignmentEntity.assignGroupId)
|
||||||
|
.and(
|
||||||
|
imageryEntity
|
||||||
|
.year
|
||||||
|
.eq(mapSheetAnalDataInferenceGeomEntity.compareYyyy)
|
||||||
|
.or(
|
||||||
|
imageryEntity.year.eq(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy))))
|
||||||
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
||||||
|
.groupBy(
|
||||||
|
labelingAssignmentEntity.assignmentUid,
|
||||||
|
labelingAssignmentEntity.inferenceGeomUid,
|
||||||
|
labelingAssignmentEntity.workerUid,
|
||||||
|
labelingAssignmentEntity.workState,
|
||||||
|
labelingAssignmentEntity.assignGroupId,
|
||||||
|
mapInkx5kEntity.mapidNm,
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.pnu,
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.geom)
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
.orderBy(
|
.orderBy(
|
||||||
@@ -66,9 +100,31 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntity.geoUid))
|
mapSheetAnalDataInferenceGeomEntity.geoUid))
|
||||||
.innerJoin(mapInkx5kEntity)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
|
.leftJoin(imageryEntity)
|
||||||
|
.on(
|
||||||
|
imageryEntity
|
||||||
|
.scene5k
|
||||||
|
.eq(labelingAssignmentEntity.assignGroupId)
|
||||||
|
.and(
|
||||||
|
imageryEntity
|
||||||
|
.year
|
||||||
|
.eq(mapSheetAnalDataInferenceGeomEntity.compareYyyy)
|
||||||
|
.or(
|
||||||
|
imageryEntity.year.eq(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy))))
|
||||||
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
||||||
|
.groupBy(labelingAssignmentEntity.assignmentUid)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return new PageImpl<>(list, pageable, count);
|
return new PageImpl<>(list, pageable, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private StringExpression makeCogUrl(NumberPath<Integer> year) {
|
||||||
|
return new CaseBuilder()
|
||||||
|
.when(imageryEntity.year.eq(year))
|
||||||
|
.then(
|
||||||
|
Expressions.stringTemplate(
|
||||||
|
"{0} || {1}", imageryEntity.cogMiddlePath, imageryEntity.cogFilename))
|
||||||
|
.otherwise("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.kamco.cd.kamcoback.trainingdata.dto;
|
package com.kamco.cd.kamcoback.trainingdata.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -16,7 +20,6 @@ public class TrainingDataLabelDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
|
||||||
public static class LabelingListDto {
|
public static class LabelingListDto {
|
||||||
|
|
||||||
private UUID assignmentUid;
|
private UUID assignmentUid;
|
||||||
@@ -26,6 +29,42 @@ public class TrainingDataLabelDto {
|
|||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
private String mapIdNm;
|
private String mapIdNm;
|
||||||
private Long pnu;
|
private Long pnu;
|
||||||
|
@JsonIgnore private String geom_data; // json string
|
||||||
|
private JsonNode geom;
|
||||||
|
private String beforeCogUrl;
|
||||||
|
private String afterCogUrl;
|
||||||
|
|
||||||
|
public LabelingListDto(
|
||||||
|
UUID assignmentUid,
|
||||||
|
Long inferenceGeomUid,
|
||||||
|
String workerUid,
|
||||||
|
String workState,
|
||||||
|
String mapSheetNum,
|
||||||
|
String mapIdNm,
|
||||||
|
Long pnu,
|
||||||
|
String geom_data,
|
||||||
|
String beforeCogUrl,
|
||||||
|
String afterCogUrl) {
|
||||||
|
this.assignmentUid = assignmentUid;
|
||||||
|
this.inferenceGeomUid = inferenceGeomUid;
|
||||||
|
this.workerUid = workerUid;
|
||||||
|
this.workState = workState;
|
||||||
|
this.mapSheetNum = mapSheetNum;
|
||||||
|
this.mapIdNm = mapIdNm;
|
||||||
|
this.pnu = pnu;
|
||||||
|
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
JsonNode geomJson;
|
||||||
|
try {
|
||||||
|
geomJson = mapper.readTree(geom_data);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
this.geom = geomJson;
|
||||||
|
|
||||||
|
this.beforeCogUrl = beforeCogUrl;
|
||||||
|
this.afterCogUrl = afterCogUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(name = "searchReq", description = "검색 요청")
|
@Schema(name = "searchReq", description = "검색 요청")
|
||||||
|
|||||||
Reference in New Issue
Block a user