| | |
| | | |
| | | 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.*; |
| | | |
| | |
| | | * 面状航线 |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | public class PlaneCourseUtils { |
| | | |
| | | /** |
| | |
| | | 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; |
| | | } |
| | |
| | | // 航向重叠计算 待完成 |
| | | |
| | | // 旁向重叠计算 |
| | | double distance2 = PlaneCourseUtils.get(param.getHeight(), param.getFrame(), param.getFocal(), 0.8); |
| | | double distance2 = PlaneCourseUtils.get(param.getHeight(), param.getFrame(), param.getFocal(), param.getSideRatio()); |
| | | System.out.println("旁向重叠计算距离:" + distance2 * 100 / 100); |
| | | int intValue = (int) distance2; |
| | | |