From 101b8bc99c8eefd7e1ae43c9a99f3e42318c87ad Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 20 九月 2023 13:50:25 +0800
Subject: [PATCH] 1

---
 ExportMap/cs/PyLasUtils.cs                 |    8 ++++----
 ExportMap/Controllers/ConvertController.cs |   32 ++------------------------------
 ExportMap/export.html                      |    2 +-
 3 files changed, 7 insertions(+), 35 deletions(-)

diff --git a/ExportMap/Controllers/ConvertController.cs b/ExportMap/Controllers/ConvertController.cs
index b4bb01d..1c9abb4 100644
--- a/ExportMap/Controllers/ConvertController.cs
+++ b/ExportMap/Controllers/ConvertController.cs
@@ -27,7 +27,7 @@
             //TerrainUtils.Project("D:/xyz/dem/dem/32a_4326_.tif", "EPSG:4490");
 
             //string wkt = TerrainUtils.GetPointZ(new XYZArgs() { dircode = "0B" });
-            string str = PyLasUtils.CsTransform("EPSG:4528", 400925.079, 2541768.173);
+            PyLasUtils.CsTransform("EPSG:4528", 400925.079, 2541768.173);
 
             return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         }
@@ -129,35 +129,7 @@
                 checkMinMax(args);
 
                 string err = null;
-                List<int> rs = TerraUtils.Generate(args, ref err);
-                if (null == rs || rs.Count == 0)
-                {
-                    return ResponseMsg<string>.fail(null == err ? "澶辫触" : err);
-                }
-
-                return ResponseMsg<string>.success("鎴愬姛", string.Join(",", rs), rs.Count);
-            }
-            catch (Exception ex)
-            {
-                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
-                return ResponseMsg<string>.fail(ex.Message);
-            }
-        }
-
-        /// <summary>
-        /// 杞崲鍦板舰
-        /// </summary>
-        [HttpPost]
-        public ResponseMsg<string> ToTerrain([FromBody]XYZArgs args)
-        {
-            try
-            {
-                ResponseMsg<string> msg = checkArgs(args, true);
-                if (null != msg) return msg;
-
-                checkMinMax(args);
-
-                string err = null;
+                //List<int> rs = TerraUtils.Generate(args, ref err);
                 List<int> rs = TerrainUtils.Generate(args, ref err);
                 if (null == rs || rs.Count == 0)
                 {
diff --git a/ExportMap/cs/PyLasUtils.cs b/ExportMap/cs/PyLasUtils.cs
index 95fbc34..8ba8eab 100644
--- a/ExportMap/cs/PyLasUtils.cs
+++ b/ExportMap/cs/PyLasUtils.cs
@@ -110,18 +110,18 @@
         /// <summary>
         /// 鍧愭爣杞崲
         /// </summary>
-        public static string CsTransform(string epsg, double x, double y, double z = 0)
+        public static void CsTransform(string epsg, double x, double y, double z = 0)
         {
             List<string> cmds = new List<string>();
 
             string gdalPath = Tools.GetSetting("gdalPath");
             cmds.Add(string.Format("\"{0}\\gdaltransform.exe\" -s_srs EPSG:{1} -t_srs EPSG:4326", gdalPath, epsg.Replace("EPSG:", "")));
-            cmds.Add(string.Format("{0} {1} {2}\n", x, y, z));
+            cmds.Add(string.Format("echo {0} {1} {2}", x, y, z));
 
             string rs = null;
-            rs =Tools.ExecCmd(cmds);
+            string str = Tools.ExecCmd(cmds, ref rs);
 
-            return rs;
+            //return rs;
         }
     }
 }
diff --git a/ExportMap/export.html b/ExportMap/export.html
index 15f15ee..2b32324 100644
--- a/ExportMap/export.html
+++ b/ExportMap/export.html
@@ -132,7 +132,7 @@
     // 娴嬭瘯Terra锛�10526锛�10527 | 10531
     function toTerra() {
       var data = { token: token, ids: [1413, 1412], min: 0, max: 18, depcode: "00", dircode: "0B", userId: 1, name: "宸濅簩" };
-      ajax("Convert/ToTerrain", "POST", JSON.stringify(data), null, null, function (rs) {
+      ajax("Convert/ToTerra", "POST", JSON.stringify(data), null, null, function (rs) {
         alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
         console.log(rs);
       });

--
Gitblit v1.9.3