张洋洋
2025-02-24 9804628abf554c3658345fc8fc9472cfb179fd5f
src/main/java/com/se/simu/controller/SimuController.java
@@ -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.getPoint(dtos.get(1).getLon(),dtos.get(1).getLat()));
        array.add(ProjectionToGeographicUtil.getPoint(dtos.get(2).getLon(),dtos.get(2).getLat()));
        array.add(ProjectionToGeographicUtil.getPoint(dtos.get(3).getLon(),dtos.get(3).getLat()));
        array.add(ProjectionToGeographicUtil.getPoint(dtos.get(0).getLon(),dtos.get(0).getLat()));
        //jsonObject.put("vertices", TiffCoordinateExtractorUtil.getCoordinate(tifPath));
        jsonObject.put("vertices", array);
        FileWriter fileWriter = new FileWriter(path + "terrain.json");
        fileWriter.write(jsonObject.toJSONString());
        fileWriter.close();