gushoubang 3 hónapja
szülő
commit
fbbf0a170e

+ 20 - 20
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/gdbh/impl/TGdbhGdServiceImpl.java

@@ -223,31 +223,31 @@ public class TGdbhGdServiceImpl implements ITGdbhGdService {
             writer.write("</style>");
             writer.newLine(); // 写入换行
             int len = flightDtoList.size();
+            boolean qiehuan = false;
+            String writetilt = tilt;
+            String writeheading = heading;
+
+            TGdbhFlightDto dto_0 = flightDtoList.get(0);
+            TGdbhFlightDto dto_1 = flightDtoList.get(1);
+            Double dr_mr = Double.valueOf(tGdbhFlightMapper.stAzimuth(dto_0.getLongitude(), dto_0.getLatitude(), dto_1.getLongitude(), dto_1.getLatitude()));
+
             for (int i = 0; i < flightDtoList.size(); i++) {
                 TGdbhFlightDto dto = flightDtoList.get(i);
                 if (i > 0 && i + 1 < len) {
-                    TGdbhFlightDto dto_qian = flightDtoList.get(i - 1);
                     TGdbhFlightDto dto_hou = flightDtoList.get(i + 1);
-                    Double dr_qian = Double.valueOf(tGdbhFlightMapper.stAzimuth(dto.getLongitude(), dto.getLatitude(), dto_qian.getLongitude(), dto_qian.getLatitude()));
-                    Double dr_hou = Double.valueOf(tGdbhFlightMapper.stAzimuth(dto_hou.getLongitude(), dto_hou.getLatitude(), dto.getLongitude(), dto.getLatitude()));
-//                    System.out.println("dr_qian:" + dr_qian);
-//                    System.out.println("dr_hou:" + dr_hou);
-                    Double dr = Math.abs(dr_hou - dr_qian);
-                    if (dr > 10) {
-                        tilt = "0.100000000000000006";
+                    Double dr_hou = Double.valueOf(tGdbhFlightMapper.stAzimuth(dto.getLongitude(), dto.getLatitude(), dto_hou.getLongitude(), dto_hou.getLatitude()));
+                    Double dr = Math.abs(dr_mr - dr_hou);
+                    if (dr > 10 && dr < 160) {
+                        writetilt = "0.100000000000000006";
+                        writeheading = heading;
+                    } else if (dr > 160) {
+//                        writetilt = (360 - Double.parseDouble(tilt)) + "";
+                        writeheading = "180.0";
+                        writetilt = tilt;
                     } else {
-                        if (i > 3) {
-                            TGdbhFlightDto dto_pingxing2 = flightDtoList.get(i - 2);
-                            TGdbhFlightDto dto_pingxing3 = flightDtoList.get(i - 3);
-                            Double dr_pingxing = Double.valueOf(tGdbhFlightMapper.stAzimuth(dto_pingxing3.getLongitude(), dto_pingxing3.getLatitude(), dto_pingxing2.getLongitude(), dto_pingxing2.getLatitude()));
-                            Double dr_px = Math.abs(dr_qian - dr_pingxing);
-                            System.out.println("dr_px:" + dr_px);
-                            if (dr_px > 160) {
-                                tilt = (360 - Double.parseDouble(tilt)) + "";
-                            }
-                        }
+                        writetilt = tilt;
+                        writeheading = heading;
                     }
-
                 }
                 String height = dto.getHeight();
                 if (null != tGdbhFlightBatchDto) {
@@ -255,7 +255,7 @@ public class TGdbhGdServiceImpl implements ITGdbhGdService {
                         height = tGdbhFlightBatchDto.getHeight();
                     }
                 }
-                String fpf = "<routestop name=\"" + dto.getPhoto_name() + "\" speed=\"0\" excluded=\"False\" viewType=\"camera\">" + "<camera>" + "<longitude>" + dto.getLongitude() + "</longitude>" + "<latitude>" + dto.getLatitude() + "</latitude>" + "<altitude>" + height + "</altitude>" + "<heading>" + heading + "</heading>" + "<tilt>" + tilt + "</tilt>" + "<altitudeMode>Absolute</altitudeMode>" + "</camera>" + "<style>" + "<geostyle3d>" + "<icon/>" + "<markersize>4.8</markersize>" + "<markericonscale>1</markericonscale>" + "<markercolor>RGBA(255,255,255,255)</markercolor>" + "</geostyle3d>" + "</style>" + "<setting>" + "<turnTime>1.5</turnTime>" + "<turnSlowly>False</turnSlowly>" + "<stopPlayMode>StopPause</stopPlayMode>" + "<autoPlay>False</autoPlay>" + "<pauseTime>0</pauseTime>" + "<angularSpeed>1</angularSpeed>" + "</setting>" + "</routestop>";
+                String fpf = "<routestop name=\"" + dto.getPhoto_name() + "\" speed=\"0\" excluded=\"False\" viewType=\"camera\">" + "<camera>" + "<longitude>" + dto.getLongitude() + "</longitude>" + "<latitude>" + dto.getLatitude() + "</latitude>" + "<altitude>" + height + "</altitude>" + "<heading>" + heading + "</heading>" + "<tilt>" + writetilt + "</tilt>" + "<altitudeMode>Absolute</altitudeMode>" + "</camera>" + "<style>" + "<geostyle3d>" + "<icon/>" + "<markersize>4.8</markersize>" + "<markericonscale>1</markericonscale>" + "<markercolor>RGBA(255,255,255,255)</markercolor>" + "</geostyle3d>" + "</style>" + "<setting>" + "<turnTime>1.5</turnTime>" + "<turnSlowly>False</turnSlowly>" + "<stopPlayMode>StopPause</stopPlayMode>" + "<autoPlay>False</autoPlay>" + "<pauseTime>0</pauseTime>" + "<angularSpeed>1</angularSpeed>" + "</setting>" + "</routestop>";
                 writer.write(fpf);
                 writer.newLine(); // 写入换行
             }