瀏覽代碼

点 线目标条带计算

wurui 8 月之前
父節點
當前提交
8e7b03d011

+ 9 - 0
orbit-base-biz/base-biz-api/src/main/java/com/base/api/model/PointRpcDTO.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class PointRpcDTO {
@@ -25,4 +26,12 @@ public class PointRpcDTO {
     private Date createTime;
 
     private String parentName;
+    private Date targetTime;//目标时刻
+    /*线目标业务使用 用于判断条带是否合理 计算当前两个点中心点*/
+    private List<PointRpcDTO> pointRpcDTOS;//目标类型
+    private String targetType;//目标类型
+
+    private String hotspot;//是否是热点 0是热点 1普通
+
+    private String iscover;//当目标类型是点群时 需要这个字段判断该点是否被覆盖 0覆盖 1没有覆盖
 }

+ 8 - 0
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/model/entity/PointInfo.java

@@ -31,4 +31,12 @@ public class PointInfo {
 
     private String parentName;
 
+    private Date targetTime;//目标时刻
+
+    private String targetType;//目标类型
+
+    private String hotspot;//是否是热点 0是热点 1普通
+
+    private String iscover;//当目标类型是点群时 需要这个字段判断该点是否被覆盖 0覆盖 1没有覆盖
+
 }

+ 17 - 0
orbit-base-plan/base-plan-service/pom.xml

@@ -138,6 +138,23 @@
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-autoconfigure</artifactId>
         </dependency>
+
+
+        <dependency>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt-main</artifactId>
+            <version>24.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt-metadata</artifactId>
+            <version>24.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.locationtech.jts</groupId>
+            <artifactId>jts-core</artifactId>
+            <version>1.19.0</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 18 - 0
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/model/enums/PointTypeEnumes.java

@@ -0,0 +1,18 @@
+package com.base.plan.model.enums;
+
+public enum PointTypeEnumes {
+    /**
+     * 移动点目标
+     */
+    MOVEPOINT,
+
+    /**
+     * 线目标
+     */
+    LINE,
+
+    /**
+     * 点群目标
+     */
+    GROUPPOINT;
+}

+ 153 - 94
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/service/StripService.java

@@ -32,11 +32,13 @@ import com.base.plan.model.dto.StripDTO;
 import com.base.plan.model.dto.*;
 import com.base.plan.model.dto.request.*;
 import com.base.plan.model.entity.*;
+import com.base.plan.model.enums.PointTypeEnumes;
 import com.base.plan.model.enums.TaskStateEnums;
 import com.base.plan.model.input.SarInput;
 import com.base.plan.mq.model.*;
 import com.base.plan.service.biz.StripBiz;
 import com.base.plan.utils.FileUploadUtil;
+import com.base.plan.utils.LaLonUtil;
 import com.base.plan.utils.ReadTxtFileTool;
 import com.base.task.TaskInitialize;
 import com.base.task.cdlatch.aop.Countdlatch;
@@ -820,113 +822,170 @@ public class StripService extends ServiceImpl<StripMapper, StripInfo> {
 
 
             log.info("开始计算:{}", System.currentTimeMillis());
-            List<SatelliteIdAndPayloadDTO> dtos = satelliteIdCastDTO(targetRelationDTO.getSatelliteSelected());
             threadPoolTaskExecutor.execute(() -> {
-                for (SatelliteIdAndPayloadDTO dto : dtos) {
-                    //根据卫星id查询载荷
-                    List<PayloadRpcDTO> payloadRpcDTOS = payloadRpcDTOList
-                            .stream()
-                            .filter(t -> t.getSatelliteId().equals(dto.getSatelliteId()))
-                            .collect(Collectors.toList());
-
-                    if (!CollectionUtils.isEmpty(payloadRpcDTOS)) {
-                        for (PayloadRpcDTO payloadRpcDTO : payloadRpcDTOS) {
+                List<PointRpcDTO> value=targetRelationDTO.getPointDTOList();
+                /**
+                 * 1.构建观测区域
+                 * 2.根据观测区域获取可见星下点数据
+                 */
+                System.out.println("====================构建观测区域===================");
+
+                //判断是那个类型的目标 目前只有移动点目标 线目标 点群目标需要做单独处理
+                if (value.get(0).getTargetType().equals(PointTypeEnumes.MOVEPOINT.toString())){
+                    //移动点目标
+                    //根据 航向 航速 时间进行轨迹推算 取得所需时刻后的目标点位
+                    LaLonUtil.deadReckoning("","","","","");
+                }
+
+                Map<Integer, List<PointRpcDTO>> PointRpcDTOmapNew=new HashMap<>();
+
+                if (value.get(0).getTargetType().equals(PointTypeEnumes.LINE.toString())){
+                    //线目标
+                    //先将多点目标按照时间连城线并绘制区域
+                    PointRpcDTO pointRpcDTO1=new PointRpcDTO();
+                    PointRpcDTO pointRpcDTO2=new PointRpcDTO();
+                    for (int i=0;i<value.size();i++){
+                        if (i!=value.size()-1){
+                            pointRpcDTO1=value.get(i);
+                            pointRpcDTO2=value.get(i+1);
+                            //两点连线转区域
+                            List<PointRpcDTO> pointRpcDTOList2=new ArrayList<>();
+                            pointRpcDTOList2= LaLonUtil.draw(pointRpcDTO1,pointRpcDTO2);
+                            PointRpcDTOmapNew.put(i,pointRpcDTOList2);
+                        }
+                    }
+
+                }
+                if (value.get(0).getTargetType().equals(PointTypeEnumes.GROUPPOINT.toString())){
+                    //点群目标
+                    //先绘制点群外接四边形区域
+                    List<PointRpcDTO> pointRpcDTOList2=new ArrayList<>();
+                    pointRpcDTOList2=LaLonUtil.getregion(value);
+                    value=new ArrayList<>();
+                    value=pointRpcDTOList2;
+                }
+
+                if (!CollectionUtils.isEmpty(PointRpcDTOmapNew)) {
+                    PointRpcDTOmapNew.forEach((key1, value1) -> {
+                        count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
+                        );
+                    });
+
+                }else {
+                    count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
+                    );
+                }
+            });
+            log.info("结束计算:{}", System.currentTimeMillis());
+        }
+    }
+
+    public void count(TargetDemandRpcDTO targetRelationDTO ,List<PayloadRpcDTO> payloadRpcDTOList
+            ,ArrayList<StripCalcResult> stripCalcResults
+            ,AtomicLong primaryKeyGenerator) {
+        List<SatelliteIdAndPayloadDTO> dtos = satelliteIdCastDTO(targetRelationDTO.getSatelliteSelected());
+        for (SatelliteIdAndPayloadDTO dto : dtos) {
+            //根据卫星id查询载荷
+            List<PayloadRpcDTO> payloadRpcDTOS = payloadRpcDTOList
+                    .stream()
+                    .filter(t -> t.getSatelliteId().equals(dto.getSatelliteId()))
+                    .collect(Collectors.toList());
+
+            if (!CollectionUtils.isEmpty(payloadRpcDTOS)) {
+                for (PayloadRpcDTO payloadRpcDTO : payloadRpcDTOS) {
     /*                //暂时使用第一个载荷 不知道一个卫星是否确定对应一个载荷
                 PayloadRpcDTO payloadRpcDTO = payloadRpcDTOS.get(0);*/
-                            //  根据卫星id查询卫星信息
-                            //                SatelliteRpcDTO satellite = satelliteRpcService.queryAllSatelliteByIds(Lists.newArrayList(dto.getSatelliteId())).get(0);
-
-                            List<BizReq> bizReqs = new ArrayList<>();
-                            List<EphTrack> ephdatas = new ArrayList<>();
-                            BizReq bizReq = new BizReq();
-                            StripCalcResult stripCalcResult = new StripCalcResult();
-                            String stripCalcResultId = UUID.randomUUID().toString().replace("-", "") + primaryKeyGenerator.getAndIncrement();
-                            stripCalcResult.setStripCalcResultId(stripCalcResultId);
-                            stripCalcResult.setTargetCode(targetRelationDTO.getTargetCode());
-                            stripCalcResult.setTargetName(targetRelationDTO.getTargetName());
-                            stripCalcResult.setStartTime(targetRelationDTO.getStartTime());
-                            stripCalcResult.setEndTime(targetRelationDTO.getEndTime());
-                            stripCalcResult.setParentId(targetRelationDTO.getParentId());
-                            stripCalcResult.setSatelliteCode(payloadRpcDTO.getSatelliteCode());
-                            try {
-                                /**
-                                 * 1.构建观测区域
-                                 * 2.根据观测区域获取可见星下点数据
-                                 */
-                                Region regionCoreDTO = getRegionCoreDTO(targetRelationDTO.getPointDTOList());
-
-                                if (payloadRpcDTO.getPayloadType().equals("SAR")) {
-                                    if (targetRelationDTO.getPointDTOList().size() == 1) {
-                                        //设置观测区域类型,0为点目标
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
-                                        regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_SAR));
-                                    } else {
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
-                                        regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_SAR));
-                                    }
-                                } else if (payloadRpcDTO.getPayloadType().equals("CCD") || payloadRpcDTO.getPayloadType().equals("wg")
-                                        || payloadRpcDTO.getPayloadType().equals("IRS") || payloadRpcDTO.getPayloadType().equals("wb")) {
-                                    if (targetRelationDTO.getPointDTOList().size() == 1) {
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
-                                        regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_CCD_COMMON));
-                                        /*regionCoreDTO.setUpdown(1);*/
-                                    } else {
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
-                                        regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
-                                        /*regionCoreDTO.setUpdown(1);*/
-                                    }
-                                }/* else if (payloadRpcDTO.getType().equals("IRS")) {
+                    //  根据卫星id查询卫星信息
+                    //                SatelliteRpcDTO satellite = satelliteRpcService.queryAllSatelliteByIds(Lists.newArrayList(dto.getSatelliteId())).get(0);
+
+                    List<BizReq> bizReqs = new ArrayList<>();
+                    List<EphTrack> ephdatas = new ArrayList<>();
+                    BizReq bizReq = new BizReq();
+                    StripCalcResult stripCalcResult = new StripCalcResult();
+                    String stripCalcResultId = UUID.randomUUID().toString().replace("-", "") + primaryKeyGenerator.getAndIncrement();
+                    stripCalcResult.setStripCalcResultId(stripCalcResultId);
+                    stripCalcResult.setTargetCode(targetRelationDTO.getTargetCode());
+                    stripCalcResult.setTargetName(targetRelationDTO.getTargetName());
+                    stripCalcResult.setStartTime(targetRelationDTO.getStartTime());
+                    stripCalcResult.setEndTime(targetRelationDTO.getEndTime());
+                    stripCalcResult.setParentId(targetRelationDTO.getParentId());
+                    stripCalcResult.setSatelliteCode(payloadRpcDTO.getSatelliteCode());
+                    try {
+                        /**
+                         * 1.构建观测区域
+                         * 2.根据观测区域获取可见星下点数据
+                         */
+                        Region regionCoreDTO = getRegionCoreDTO(targetRelationDTO.getPointDTOList());
+
+                        if (payloadRpcDTO.getPayloadType().equals("SAR")) {
+                            if (targetRelationDTO.getPointDTOList().size() == 1) {
+                                //设置观测区域类型,0为点目标
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
+                                regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_SAR));
+                            } else {
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
+                                regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_SAR));
+                            }
+                        } else if (payloadRpcDTO.getPayloadType().equals("CCD") || payloadRpcDTO.getPayloadType().equals("wg")
+                                || payloadRpcDTO.getPayloadType().equals("IRS") || payloadRpcDTO.getPayloadType().equals("wb")) {
+                            if (targetRelationDTO.getPointDTOList().size() == 1) {
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
+                                regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_CCD_COMMON));
+                                /*regionCoreDTO.setUpdown(1);*/
+                            } else {
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
+                                regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
+                                /*regionCoreDTO.setUpdown(1);*/
+                            }
+                        }/* else if (payloadRpcDTO.getType().equals("IRS")) {
                                 //红外 计算跟普通光学一样  星下点查询降轨 升轨都查
                                 regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
                             } */ else if (payloadRpcDTO.getPayloadType().equals("ELECTRON")) {
-                                    //电子区域
-                                    regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_ELECTRONIC));
-                                    if (targetRelationDTO.getPointDTOList().size() > 1) {
-                                        //区域
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
-                                    } else {
-                                        regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
-                                    }
-
-                                }
-                                /*regionCoreDTO.setBizSerial(req.getReqIds().get(0));*/
-                                bizReq.setRegion(regionCoreDTO);
-                                List<SubPointDataRpcDTO> subPointDataRpcDTOS = regionService.getSubPoint(regionCoreDTO, payloadRpcDTO, targetRelationDTO);
-                                if (!CollectionUtils.isEmpty(subPointDataRpcDTOS)) {
+                            //电子区域
+                            regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_ELECTRONIC));
+                            if (targetRelationDTO.getPointDTOList().size() > 1) {
+                                //区域
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
+                            } else {
+                                regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
+                            }
+
+                        }
+                        /*regionCoreDTO.setBizSerial(req.getReqIds().get(0));*/
+                        bizReq.setRegion(regionCoreDTO);
+                        List<SubPointDataRpcDTO> subPointDataRpcDTOS = regionService.getSubPoint(regionCoreDTO, payloadRpcDTO, targetRelationDTO);
+                        if (!CollectionUtils.isEmpty(subPointDataRpcDTOS)) {
                                     /*EphTrack ephTrack = ephTrackService.convertEphTrack(subPointDataRpcDTOS, payloadInfo, fzTaskInfo);
                                     ephdatas.add(ephTrack);*/
-                                    List<EphTrack> ephdatasnew = ephTrackService.convertEphTracknew(subPointDataRpcDTOS, payloadRpcDTO);
-                                    ephdatas.addAll(ephdatasnew);
-
-                                }
-                                List<EphTrackCoreDTO> ephTrackCoreDTOS = copyEph(ephdatas);
-                                bizReq.setEphTrackCoreDTOs(ephTrackCoreDTOS);
-                                bizReqs.add(bizReq);
-                                List<com.base.core.model.enity.StripDTO> stripDTOList = stripAbstractTemplate.compute(bizReqs);
-                                if (!CollectionUtils.isEmpty(stripDTOList)) {
-                                    //  原有代码一个条带生成一个筹划方案
-                                    List<AlgSchemeStepWindow> algSchemeStepWindows = formatAndBatch(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId());
-                                    try {
-                                        saveStrips(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId(), targetRelationDTO.getPointDTOList().get(0));
-                                    }catch (Exception e){
-                                        stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_FAILED);
-                                        log.info("条带保存失败!");
-                                    }
-                                    //  条带提供测控、数传列表
-                                    insetAlgSchemeWindow(targetRelationDTO, payloadRpcDTO, algSchemeStepWindows);
-                                }
-                                stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_SUCCEED);
-                            } catch (Exception e) {
-                                e.printStackTrace();
+                            List<EphTrack> ephdatasnew = ephTrackService.convertEphTracknew(subPointDataRpcDTOS, payloadRpcDTO);
+                            ephdatas.addAll(ephdatasnew);
+
+                        }
+                        List<EphTrackCoreDTO> ephTrackCoreDTOS = copyEph(ephdatas);
+                        bizReq.setEphTrackCoreDTOs(ephTrackCoreDTOS);
+                        bizReqs.add(bizReq);
+                        List<com.base.core.model.enity.StripDTO> stripDTOList = stripAbstractTemplate.compute(bizReqs);
+                        if (!CollectionUtils.isEmpty(stripDTOList)) {
+                            //  原有代码一个条带生成一个筹划方案
+                            List<AlgSchemeStepWindow> algSchemeStepWindows = formatAndBatch(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId());
+                            try {
+                                saveStrips(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId(), targetRelationDTO.getPointDTOList().get(0));
+                            }catch (Exception e){
+                                stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_FAILED);
+                                log.info("条带保存失败!");
                             }
-                            stripCalcResults.add(stripCalcResult);
+                            //  条带提供测控、数传列表
+                            insetAlgSchemeWindow(targetRelationDTO, payloadRpcDTO, algSchemeStepWindows);
                         }
+                        stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_SUCCEED);
+                    } catch (Exception e) {
+                        e.printStackTrace();
                     }
+                    stripCalcResults.add(stripCalcResult);
                 }
-                stripCalcResultService.saveBatch(stripCalcResults);
-            });
-            log.info("结束计算:{}", System.currentTimeMillis());
+            }
         }
+        stripCalcResultService.saveBatch(stripCalcResults);
     }
 
     /**

+ 254 - 0
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/utils/LaLonUtil.java

@@ -0,0 +1,254 @@
+package com.base.plan.utils;
+
+import com.base.api.model.PointRpcDTO;
+import com.base.plan.model.enums.PointTypeEnumes;
+import org.geotools.geometry.jts.JTSFactoryFinder;
+import org.locationtech.jts.geom.*;
+import org.locationtech.jts.operation.distance.DistanceOp;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LaLonUtil {
+
+    private static final double EARTH_RADIUS=6371000;//地球平均半径 单位米
+
+
+    public static List<PointRpcDTO> draw(PointRpcDTO pointRpcDTOstart,PointRpcDTO pointRpcDTOend){
+        List<PointRpcDTO> pointRpcDTOS=new ArrayList<>();
+        List<PointRpcDTO> pointRpcDTOS2=new ArrayList<>();
+        pointRpcDTOS2.add(pointRpcDTOstart);
+        pointRpcDTOS2.add(pointRpcDTOend);
+        double startLond=Double.valueOf(pointRpcDTOstart.getLongitude());
+        double strLatd=Double.valueOf(pointRpcDTOstart.getLatitude());
+        double endLond=Double.valueOf(pointRpcDTOend.getLongitude());
+        double endLatd=Double.valueOf(pointRpcDTOend.getLatitude());
+        double width = 4000; // 矩形的宽度
+        // 计算矩形中心点的经纬度
+        double centerLongitude = (startLond + endLond) / 2;
+        double centerLatitude = (strLatd + endLatd) / 2;
+
+        // 根据宽度和地球半径计算矩形在经度和纬度方向上的偏移量
+        double offsetLongitude = width / (2 * Math.cos(Math.toRadians(centerLatitude))) / 111000; // 经度方向上的偏移量(单位:米)
+        double offsetLatitude = width / 111000; // 纬度方向上的偏移量(单位:米)
+
+        // 根据中心点和偏移量计算矩形四个顶点的经纬度坐标
+        Coordinate corner1 = new Coordinate(centerLongitude - offsetLongitude, centerLatitude - offsetLatitude);
+        Coordinate corner2 = new Coordinate(centerLongitude + offsetLongitude, centerLatitude - offsetLatitude);
+        Coordinate corner3 = new Coordinate(centerLongitude + offsetLongitude, centerLatitude + offsetLatitude);
+        Coordinate corner4 = new Coordinate(centerLongitude - offsetLongitude, centerLatitude + offsetLatitude);
+        PointRpcDTO pointRpcDTO1=new PointRpcDTO();
+        pointRpcDTO1.setSort("1");
+        pointRpcDTO1.setSerial("1");
+        pointRpcDTO1.setLongitude(String.valueOf(corner1.x));
+        pointRpcDTO1.setLatitude(String.valueOf(corner1.y));
+        pointRpcDTO1.setPointType("TARGET");
+        pointRpcDTO1.setTargetType(PointTypeEnumes.LINE.toString());
+        pointRpcDTO1.setPointRpcDTOS(pointRpcDTOS2);
+        pointRpcDTOS.add(pointRpcDTO1);
+
+        PointRpcDTO pointRpcDTO2=new PointRpcDTO();
+        pointRpcDTO2.setSort("1");
+        pointRpcDTO2.setSerial("1");
+        pointRpcDTO2.setLongitude(String.valueOf(corner2.x));
+        pointRpcDTO2.setLatitude(String.valueOf(corner2.y));
+        pointRpcDTO2.setPointType("TARGET");
+        pointRpcDTO2.setTargetType(PointTypeEnumes.LINE.toString());
+        pointRpcDTO2.setPointRpcDTOS(pointRpcDTOS2);
+        pointRpcDTOS.add(pointRpcDTO2);
+
+        PointRpcDTO pointRpcDTO3=new PointRpcDTO();
+        pointRpcDTO3.setSort("1");
+        pointRpcDTO3.setSerial("1");
+        pointRpcDTO3.setLongitude(String.valueOf(corner3.x));
+        pointRpcDTO3.setLatitude(String.valueOf(corner3.y));
+        pointRpcDTO3.setPointType("TARGET");
+        pointRpcDTO3.setTargetType(PointTypeEnumes.LINE.toString());
+        pointRpcDTO3.setPointRpcDTOS(pointRpcDTOS2);
+        pointRpcDTOS.add(pointRpcDTO3);
+
+        PointRpcDTO pointRpcDTO4=new PointRpcDTO();
+        pointRpcDTO4.setSort("1");
+        pointRpcDTO4.setSerial("1");
+        pointRpcDTO4.setLongitude(String.valueOf(corner4.x));
+        pointRpcDTO4.setLatitude(String.valueOf(corner4.y));
+        pointRpcDTO4.setPointType("TARGET");
+        pointRpcDTO4.setTargetType(PointTypeEnumes.LINE.toString());
+        pointRpcDTO4.setPointRpcDTOS(pointRpcDTOS2);
+        pointRpcDTOS.add(pointRpcDTO4);
+        System.out.println("左上角坐标:" + "[" + corner1.x + ", " +corner1.y + "]");
+        System.out.println("右上角坐标:" + "[" + corner2.x + ", " + corner2.y + "]");
+        System.out.println("右下角坐标:" + "[" + corner3.x + ", " + corner3.y + "]");
+        System.out.println("左下角坐标:" + "[" + corner4.x + ", " + corner4.y + "]");
+        return pointRpcDTOS;
+    }
+
+    public static void deadReckoning(String startlon ,String startlat,String speed,String time,String heading){
+        double startlond=Double.valueOf(startlon);
+        double startlatd=Double.valueOf(startlat);
+        double speedd=Double.valueOf(speed); //公里每小时
+        double timed=Double.valueOf(time);//小时
+        double headingd=Double.valueOf(heading);//航向 度
+
+        double deltaLat = calculateDeltaLat(speedd, timed, headingd, startlatd);
+        double deltaLon = calculateDeltaLon(speedd, timed, headingd, startlond);
+
+        double nextLatitude = deltaLat + deltaLat;
+        double nextLongitude = deltaLon + deltaLon;
+
+        System.out.println("下一个点的经纬度是: " + nextLatitude + ", " + nextLongitude);
+
+    }
+
+    public static double calculateDeltaLat(double speed, double time, double heading, double currentLatitude) {
+        double radianHeading = Math.toRadians(heading);
+        return speed * time * Math.cos(Math.toRadians(currentLatitude)) / (40075 * Math.cos(radianHeading));
+    }
+
+    public static double calculateDeltaLon(double speed, double time, double heading, double currentLongitude) {
+        double radianHeading = Math.toRadians(heading);
+        return speed * time / (40075 * Math.cos(radianHeading));
+    }
+
+    public  static double countdistance(double lat1,double lon1,double lat2,double lon2){
+        double radLat1 = Math.toRadians(lat1);
+        double radLon1 = Math.toRadians(lon1);
+        double radLat2 = Math.toRadians(lat2);
+        double radLon2 = Math.toRadians(lon2);
+
+        double a = Math.sin((radLat2-radLat1)/2) * Math.sin((radLat2-radLat1)/2) +
+                Math.cos(radLat1) * Math.cos(radLat2) *
+                        Math.sin((radLon2-radLon1)/2) * Math.sin((radLon2-radLon1)/2);
+
+        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
+        double distanceInKilometers = EARTH_RADIUS * c;
+
+        return distanceInKilometers;
+    }
+
+    public static List<PointRpcDTO> getregion(List<PointRpcDTO> pointRpcDTOS){
+        List<PointRpcDTO> pointRpcDTOList=new ArrayList<>();
+        // 初始化最大和最小经纬度值
+        double maxLongitude = Double.NEGATIVE_INFINITY;
+        double minLongitude = Double.POSITIVE_INFINITY;
+        double maxLatitude = Double.NEGATIVE_INFINITY;
+        double minLatitude = Double.POSITIVE_INFINITY;
+
+        // 遍历经纬度点找出最大和最小经纬度
+        for (PointRpcDTO point : pointRpcDTOS) {
+            if (Double.valueOf(point.getLongitude()) > maxLongitude) {
+                maxLongitude = Double.valueOf(point.getLongitude());
+            }
+            if (Double.valueOf(point.getLongitude()) < minLongitude) {
+                minLongitude = Double.valueOf(point.getLongitude());
+            }
+            if (Double.valueOf(point.getLatitude())> maxLatitude) {
+                maxLatitude = Double.valueOf(point.getLatitude());
+            }
+            if (Double.valueOf(point.getLatitude())< minLatitude) {
+                minLatitude = Double.valueOf(point.getLatitude());
+            }
+        }
+
+        // 输出外接矩形四个点的坐标
+        System.out.println("左上角点坐标:" + maxLongitude + ", " + maxLatitude);
+        System.out.println("右上角点坐标:" + maxLongitude + ", " + minLatitude);
+        System.out.println("左下角点坐标:" + minLongitude + ", " + maxLatitude);
+        System.out.println("右下角点坐标:" + minLongitude + ", " + minLatitude);
+        PointRpcDTO pointRpcDTO1=new PointRpcDTO();
+        pointRpcDTO1.setSort("1");
+        pointRpcDTO1.setSerial("1");
+        pointRpcDTO1.setLongitude(String.valueOf(maxLongitude));
+        pointRpcDTO1.setLatitude(String.valueOf(maxLatitude));
+        pointRpcDTO1.setPointType("TARGET");
+        pointRpcDTO1.setTargetType(PointTypeEnumes.GROUPPOINT.toString());
+        pointRpcDTO1.setPointRpcDTOS(pointRpcDTOS);
+        pointRpcDTOList.add(pointRpcDTO1);
+
+        PointRpcDTO pointRpcDTO2=new PointRpcDTO();
+        pointRpcDTO2.setSort("1");
+        pointRpcDTO2.setSerial("1");
+        pointRpcDTO2.setLongitude(String.valueOf(maxLongitude));
+        pointRpcDTO2.setLatitude(String.valueOf(minLatitude));
+        pointRpcDTO2.setPointType("TARGET");
+        pointRpcDTO2.setTargetType(PointTypeEnumes.GROUPPOINT.toString());
+        pointRpcDTO2.setPointRpcDTOS(pointRpcDTOS);
+        pointRpcDTOList.add(pointRpcDTO2);
+
+        PointRpcDTO pointRpcDTO3=new PointRpcDTO();
+        pointRpcDTO3.setSort("1");
+        pointRpcDTO3.setSerial("1");
+        pointRpcDTO3.setLongitude(String.valueOf(minLongitude));
+        pointRpcDTO3.setLatitude(String.valueOf(minLatitude));
+        pointRpcDTO3.setPointType("TARGET");
+        pointRpcDTO3.setTargetType(PointTypeEnumes.GROUPPOINT.toString());
+        pointRpcDTO3.setPointRpcDTOS(pointRpcDTOS);
+        pointRpcDTOList.add(pointRpcDTO3);
+
+        PointRpcDTO pointRpcDTO4=new PointRpcDTO();
+        pointRpcDTO4.setSort("1");
+        pointRpcDTO4.setSerial("1");
+        pointRpcDTO4.setLongitude(String.valueOf(minLongitude));
+        pointRpcDTO4.setLatitude(String.valueOf(maxLatitude));
+        pointRpcDTO4.setPointType("TARGET");
+        pointRpcDTO4.setTargetType(PointTypeEnumes.GROUPPOINT.toString());
+        pointRpcDTO4.setPointRpcDTOS(pointRpcDTOS);
+        pointRpcDTOList.add(pointRpcDTO4);
+
+        return pointRpcDTOList;
+    }
+
+    public static boolean pointInRectangle(PointRpcDTO p,List<PointRpcDTO> pointRpcDTOSstrip){
+        // 创建点对象
+        Coordinate pointCoord = new Coordinate(Double.valueOf(p.getLongitude()), Double.valueOf(p.getLatitude())); // 经度和纬度
+
+        GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
+        Point point = geometryFactory.createPoint(pointCoord);
+
+        // 创建矩形区域对象
+        PointRpcDTO p0=pointRpcDTOSstrip.get(0);
+        PointRpcDTO p1=pointRpcDTOSstrip.get(1);
+        PointRpcDTO p2=pointRpcDTOSstrip.get(2);
+        PointRpcDTO p3=pointRpcDTOSstrip.get(3);
+        Coordinate[] rectangleCoords = new Coordinate[]{
+                new Coordinate(Double.valueOf(p0.getLongitude()), Double.valueOf(p0.getLatitude())), // 左上角坐标
+                new Coordinate(Double.valueOf(p1.getLongitude()), Double.valueOf(p1.getLatitude())), // 右上角坐标
+                new Coordinate(Double.valueOf(p2.getLongitude()), Double.valueOf(p2.getLatitude())), // 右下角坐标
+                new Coordinate(Double.valueOf(p3.getLongitude()), Double.valueOf(p3.getLatitude())), // 左下角坐标
+                new Coordinate(Double.valueOf(p0.getLongitude()), Double.valueOf(p0.getLatitude()))
+        };
+        Polygon rectangle = geometryFactory.createPolygon(rectangleCoords);
+
+        // 判断点是否在矩形区域内
+        boolean isInside = rectangle.contains(point);
+
+        System.out.println("点是否在矩形区域内:" + isInside);
+        return isInside;
+    }
+
+    public static double pointToLineSegment(PointRpcDTO p,PointRpcDTO p1,PointRpcDTO p2){
+/*        GeometryFactory geometryFactory=new GeometryFactory();
+        Point point=geometryFactory.createPoint(new Coordinate(Double.valueOf(p.getLongitude()), Double.valueOf(p.getLatitude())));
+        LineString lineString=geometryFactory.createLineString(
+                new Coordinate[]{new Coordinate(Double.valueOf(p1.getLongitude()), Double.valueOf(p1.getLatitude())),
+                new Coordinate(Double.valueOf(p2.getLongitude()), Double.valueOf(p2.getLatitude()))}
+        );
+        double distance = point.distance(lineString);*/
+        // 创建点对象
+        Coordinate pointCoord = new Coordinate(Double.valueOf(p.getLongitude()), Double.valueOf(p.getLatitude()));
+        GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
+        Point point = geometryFactory.createPoint(pointCoord);
+
+        // 创建线段对象
+        Coordinate lineStartCoord = new Coordinate(Double.valueOf(p1.getLongitude()), Double.valueOf(p1.getLatitude()));
+        Coordinate lineEndCoord = new Coordinate(Double.valueOf(p2.getLongitude()), Double.valueOf(p2.getLatitude()));
+        LineString line = geometryFactory.createLineString(new Coordinate[]{lineStartCoord, lineEndCoord});
+
+        // 计算点到线段的最近距离
+        double distance = DistanceOp.distance(point, line);
+
+        System.out.println("点到线段的距离为米:" + distance);
+        return distance;
+    }
+
+}