张洋洋
2025-02-27 50423e90b61aededf6e1ff6c4c423c84c4f39fa3
src/main/java/com/se/simu/controller/SimuController.java
@@ -386,18 +386,18 @@
                return fail("sem文件生成路径不能为空!", false);
            }
            List<GridDto> dtos = new ArrayList<>();
            dtos.add(new GridDto(vo.getMiny(), vo.getMinx()));
            dtos.add(new GridDto(vo.getMaxy(), vo.getMinx()));
            dtos.add(new GridDto(vo.getMaxy(), vo.getMaxx()));
            dtos.add(new GridDto(vo.getMiny(), vo.getMaxx()));
            dtos.add(new GridDto(vo.getMaxy(), vo.getMaxx()));
            dtos.add(new GridDto(vo.getMaxy(), vo.getMinx()));
            dtos.add(new GridDto(vo.getMiny(), vo.getMinx()));
            String bbox = "";
            //生成点和线的实体库模型并保存路径
            String name = vo.getSemUrl();
            String token = EntityLibraryUtils.login();
            vo.setPointName(name + "-point");
            vo.setLinkName(name + "-line");
            JSONArray min = ProjectionToGeographicUtil.get4548Point(dtos.get(0).getLon(), dtos.get(0).getLat());
            JSONArray max = ProjectionToGeographicUtil.get4548Point(dtos.get(2).getLon(), dtos.get(2).getLat());
            JSONArray min = ProjectionToGeographicUtil.get4548Point(dtos.get(3).getLon(), dtos.get(3).getLat());
            JSONArray max = ProjectionToGeographicUtil.get4548Point(dtos.get(1).getLon(), dtos.get(1).getLat());
            bbox = bbox + min.getDouble(0) + "," + min.getDouble(1) + "," + max.getDouble(0) + "," + max.getDouble(1);
            JSONObject point = getModule("layerQueryPointParams.json");
            String pointUrl = assemble(vo.getPointName(), point.getString("layerid"), bbox, token);
@@ -511,7 +511,7 @@
            code+=1;
            //地形生成
            terrainToSem(dtos, vo.getSemUrl());
            update(simu, code, null);
            update(simu, 10, null);
            code+=1;
            //9=调用求解/10=求解分析
        } catch (Exception e) {
@@ -920,7 +920,13 @@
        String pngPath = path + "appearance\\terrain.png";
        TiffToRGBUtil.tifToPng(tifPath, pngPath);
        JSONObject jsonObject = getModule("terrainmodule.json");
        jsonObject.put("vertices", TiffCoordinateExtractorUtil.getCoordinate(tifPath));
        JSONArray array=new JSONArray();
        array.add(ProjectionToGeographicUtil.getPointAndHight(dtos.get(0).getLon(),dtos.get(0).getLat()));
        array.add(ProjectionToGeographicUtil.getPointAndHight(dtos.get(1).getLon(),dtos.get(1).getLat()));
        array.add(ProjectionToGeographicUtil.getPointAndHight(dtos.get(2).getLon(),dtos.get(2).getLat()));
        array.add(ProjectionToGeographicUtil.getPointAndHight(dtos.get(3).getLon(),dtos.get(3).getLat()));
        //jsonObject.put("vertices", TiffCoordinateExtractorUtil.getCoordinate(tifPath));
        jsonObject.put("vertices", array);
        FileWriter fileWriter = new FileWriter(path + "terrain.json");
        fileWriter.write(jsonObject.toJSONString());
        fileWriter.close();