From faa830cd0270a78788881ee3f1a1e21ad9fe1fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dhji=28=EC=A7=80=EB=8C=80=ED=95=9C=29?= Date: Mon, 15 Jul 2024 12:50:20 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=93=9C=EB=A1=A0=EC=9B=90=EC=8A=A4?= =?UTF-8?q?=ED=83=91=20API=EC=97=90=EC=84=9C=20=EC=A0=9C=ED=95=9C=EA=B5=AC?= =?UTF-8?q?=EC=97=AD=20=EC=82=B0=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../external/service/DronOneStopService.java | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/pav-server/src/main/java/com/palnet/biz/api/external/service/DronOneStopService.java b/pav-server/src/main/java/com/palnet/biz/api/external/service/DronOneStopService.java index 26cbbcbb..245e46d6 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/external/service/DronOneStopService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/external/service/DronOneStopService.java @@ -1,5 +1,6 @@ package com.palnet.biz.api.external.service; +import com.palnet.biz.api.bas.dos.model.LimitZoneType; import com.palnet.biz.api.external.model.ApprovalCd; import com.palnet.biz.api.external.model.DosApprovalResult; import com.palnet.biz.api.external.model.DosPlanRq; @@ -222,7 +223,35 @@ public class DronOneStopService { result.setApprovalCd(ApprovalCd.APPROVAL); } - Double allowRadiusDouble = calculateAllowRadius(duplicatedAirspaces, centerPoint); + + GeometryFactory geometryFactory = new GeometryFactory(); + Point centerGeometry = geometryFactory.createPoint(centerPoint); + + // 제한 구역 체크 + duplicatedAirspaces.forEach(airspace -> { + + }); + + // 제한 구역 + for (AirspaceUtils.FeatureInfo checkAirspace : duplicatedAirspaces) { + Geometry airspaceGeometry = checkAirspace.getGeometry(); + if (!airspaceGeometry.contains(centerGeometry)) { + continue; + } + + if ("0003".equals(checkAirspace.getType())) { + // 0003: 원추 + result.setLimitZone(LimitZoneType.HORIZONTAL_SURFACE.getCode()); + break; + } else if ("0006".equals(checkAirspace.getType())) { + // 0006: 수평 + result.setLimitZone(LimitZoneType.CONICAL_SURFACE.getCode()); + break; + } + } + + + Double allowRadiusDouble = calculateAllowRadius(duplicatedAirspaces, centerGeometry); Long allowRadius = allowRadiusDouble != null ? (long) Math.floor(allowRadiusDouble) : null; Long reqRadius = allowRadius != null ? (long) Math.floor(allowRadius / 10.0) * 10 : null; result.setAllowRadius(allowRadius); @@ -231,7 +260,7 @@ public class DronOneStopService { } - private Double calculateAllowRadius(List duplicatedAirspaces, Coordinate centerPoint) { + private Double calculateAllowRadius(List duplicatedAirspaces, Point centerGeometry) { if (duplicatedAirspaces == null || duplicatedAirspaces.isEmpty()) { return null; } @@ -240,10 +269,6 @@ public class DronOneStopService { return null; } Double minDistance = null; - // 중심 Geometry - GeometryFactory geometryFactory = new GeometryFactory(); - Point centerGeometry = geometryFactory.createPoint(centerPoint); - for (AirspaceUtils.FeatureInfo airspace : duplicatedAirspaces) { // 수평 타입의 airspace만 해당