rain
2024-08-21 2db1aa88e8ab53096a936163d686b90d8e056a99
src/main/java/com/dji/sample/wayline/plane/PlaneCourseUtils.java
@@ -2,6 +2,7 @@
import com.dji.sample.patches.utils.GeoToolsUtil;
import com.dji.sample.wayline.plane.param.CreateWaylineParam;
import lombok.extern.slf4j.Slf4j;
import org.geotools.geometry.jts.JTSFactoryFinder;
import org.locationtech.jts.geom.*;
@@ -14,6 +15,7 @@
 * 面状航线
 * @Version 1.0
 */
@Slf4j
public class PlaneCourseUtils {
    /**
@@ -131,14 +133,19 @@
    private static List<MapLatLng> createPoint(MapLatLng mapLatLng, int intValue, double bearing, MapLatLng mapLatLngMin) {
        List<MapLatLng> pointList = new ArrayList<>();
        int index = 0;//防止死循环
        while (true) {
            if (index > 100)
                break ;
            MapLatLng newLocation = getBearingLatLng(mapLatLng, intValue, bearing);
            if (newLocation.getLatitude() <= mapLatLngMin.getLatitude())
                break;
            mapLatLng = newLocation;
            pointList.add(newLocation);
            System.out.println(newLocation + ",");
            index += 1;
            log.info("创建航点,当前index:{}", index);
        }
        return pointList;
    }