From 61b6a81cad8e9d2674ef265b7814041b5ce5cdac Mon Sep 17 00:00:00 2001
From: 张洋洋 <10611411+yang-yang-z@user.noreply.gitee.com>
Date: 星期一, 20 一月 2025 09:34:04 +0800
Subject: [PATCH] [add]管线json

---
 src/main/java/com/se/simu/controller/SimuController.java |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/se/simu/controller/SimuController.java b/src/main/java/com/se/simu/controller/SimuController.java
index f9bc490..dc355c6 100644
--- a/src/main/java/com/se/simu/controller/SimuController.java
+++ b/src/main/java/com/se/simu/controller/SimuController.java
@@ -490,7 +490,24 @@
         fileWriter.close();
         return success(pointPath);
     }
-
+    @ApiOperation(value = "鍦板舰杞琧ityjson")
+    @GetMapping(value = "/terrainToCityJson", produces = "application/json; charset=UTF-8")
+    public R<String> terrainToCityJson(@RequestParam("tifPath") String tifPath) throws Exception {
+        long times = System.currentTimeMillis();
+        String path = outPath + "\\terrain\\"+times+"\\";
+        File dirFile = new File(path+"appearance");
+        if (!dirFile.exists()) {
+            dirFile.mkdirs();
+        }
+        String pngPath=path+"appearance\\terrain.png";
+        TiffToRGBUtil.tifToPng(tifPath,pngPath);
+        JSONObject jsonObject = getModule("terrainmodule.json");
+        jsonObject.put("vertices",TiffCoordinateExtractorUtil.getCoordinate(tifPath));
+        FileWriter fileWriter = new FileWriter(path + "terrain.json");
+        fileWriter.write(jsonObject.toJSONString());
+        fileWriter.close();
+        return success(path);
+    }
     public JSONObject getModule(String moduleName) {
         JSONObject jsonObject = new JSONObject();
         try {

--
Gitblit v1.9.3