|
|
|
@ -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<AirspaceUtils.FeatureInfo> duplicatedAirspaces, Coordinate centerPoint) { |
|
|
|
|
private Double calculateAllowRadius(List<AirspaceUtils.FeatureInfo> 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만 해당
|
|
|
|
|