From 2953a6d4cf34e3b91005390f9874db5565092056 Mon Sep 17 00:00:00 2001
From: 张洋洋 <10611411+yang-yang-z@user.noreply.gitee.com>
Date: 星期四, 23 一月 2025 15:44:48 +0800
Subject: [PATCH] [add]cityjson转sem

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

diff --git a/src/main/java/com/se/simu/controller/SimuController.java b/src/main/java/com/se/simu/controller/SimuController.java
index dc355c6..cf7f629 100644
--- a/src/main/java/com/se/simu/controller/SimuController.java
+++ b/src/main/java/com/se/simu/controller/SimuController.java
@@ -343,7 +343,7 @@
 
     @ApiOperation(value = "tarr鏂囦欢缁勮")
     @GetMapping(value = "/saveZarr", produces = "application/json; charset=UTF-8")
-    public R<Boolean> saveZarr(@RequestParam("name") String tableName) throws IOException {
+    public R<Boolean> saveZarr(@RequestParam("name") String tableName) throws Exception {
         List<String> list = CsvToSQLiteUtils.getNameList(tableName);
         String path = outPath + "\\";
         String rainfall = "rainfall\\";
@@ -400,6 +400,7 @@
         FileWriter fileWriter = new FileWriter(path + tableName + "\\闄嶉洦閲�.json");
         fileWriter.write(jsonObject.toJSONString());
         fileWriter.close();
+        SemUtils.cityJsonToSem(path + tableName + "\\闄嶉洦閲�.json",path + tableName + "\\闄嶉洦閲�.sem");
         return success(true);
     }
 
@@ -443,6 +444,7 @@
         FileWriter fileWriter = new FileWriter(pointPath);
         fileWriter.write(jsonObject.toJSONString());
         fileWriter.close();
+        SemUtils.cityJsonToSem(pointPath,path + times + "\\绠$偣.sem");
         return success(pointPath);
     }
 
@@ -473,7 +475,9 @@
             JSONArray jsonArray=new JSONArray();
             jsonArray.add(boundarie);
             metry.put("boundaries", jsonArray);
-            cityObject.put("geometry",metry);
+            JSONArray metryArray=new JSONArray();
+            metryArray.add(metry);
+            cityObject.put("geometry",metryArray);
             cityObject.put("attributes",attribute);
             cityObject.put("attributes", attribute);
             geometry.add(metry);
@@ -488,6 +492,7 @@
         FileWriter fileWriter = new FileWriter(pointPath);
         fileWriter.write(jsonObject.toJSONString());
         fileWriter.close();
+        SemUtils.cityJsonToSem(pointPath, path + times + "\\绠$嚎.sem");
         return success(pointPath);
     }
     @ApiOperation(value = "鍦板舰杞琧ityjson")
@@ -506,6 +511,7 @@
         FileWriter fileWriter = new FileWriter(path + "terrain.json");
         fileWriter.write(jsonObject.toJSONString());
         fileWriter.close();
+        SemUtils.cityJsonToSem(path + "terrain.json", path + "terrain.sem");
         return success(path);
     }
     public JSONObject getModule(String moduleName) {

--
Gitblit v1.9.3