xieb
2024-05-06 066f132c523fb2d8dbcaf20ea900db061b068910
src/main/java/com/dji/sample/patches/utils/GeoToolsUtil.java
@@ -194,9 +194,9 @@
    public static List<PointPO> getRoutePointOrder(List<LotInfo> list, double airportLat, double airportLon) {
        List<Coordinate> centros = new ArrayList<>();
        List<List<Coordinate>> extremePoints = new ArrayList<>();
        Map<Coordinate, List<Coordinate>> points = new HashMap<>();
        AtomicInteger numSize = new AtomicInteger();
        list.forEach(patche -> {
        for (LotInfo patche : list) {
            String wkt = patche.getDkfw();
            // 解析WKT字符串为多边形
            WKTReader wktReader = new WKTReader(JTSFactoryFinder.getGeometryFactory());
@@ -209,6 +209,13 @@
            // 开始封装中心点坐标
            Coordinate coordinateCentro = getCentro(polygon);
            double distance = DistanceCalculator.calculateDistance(airportLat, airportLon, coordinateCentro.y,coordinateCentro.x);
            // 机场范围,操作机场范围将不生成
            if (distance * 1000 > 7000) {
                continue;
            }
            centros.add(coordinateCentro);
            // 开始封装图斑4个航线
@@ -219,8 +226,8 @@
            // 保存稀释拐点之后总数量
            numSize.set(numSize.get() + coordinatePointList.size());
        }
        });
        // 开始排序
        Coordinate[] coordinates = new Coordinate[centros.size() + 1];
@@ -295,7 +302,6 @@
                retcList.add(PointPO.builder().index(index).coordinate(coordinate).build());
            }
        }
        return retcList;