From d5be9e1de1a76c4f842a87035c1d5eea1faaeb2f Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期六, 15 七月 2023 15:40:00 +0800 Subject: [PATCH] 1 --- ExportMap/Controllers/ConvertController.cs | 2 ++ ExportMap/Models/XYZArgs.cs | 6 +++--- ExportMap/cs/LasUtils.cs | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ExportMap/Controllers/ConvertController.cs b/ExportMap/Controllers/ConvertController.cs index 7b0fd4e..925f942 100644 --- a/ExportMap/Controllers/ConvertController.cs +++ b/ExportMap/Controllers/ConvertController.cs @@ -143,6 +143,8 @@ ResponseMsg<string> msg = checkArgs(args); if (null != msg) return msg; + if (args.srids.Count != args.ids.Count) return ResponseMsg<string>.fail("鍧愭爣绯籌D闆嗗悎涓庡厓鏁版嵁ID闆嗗悎闀垮害涓嶄竴鑷�"); + string err = null; List<int> rs = LasUtils.Generate(args, ref err); if (null == rs || rs.Count == 0) diff --git a/ExportMap/Models/XYZArgs.cs b/ExportMap/Models/XYZArgs.cs index e5b731e..6c445dc 100644 --- a/ExportMap/Models/XYZArgs.cs +++ b/ExportMap/Models/XYZArgs.cs @@ -12,9 +12,9 @@ { public XYZArgs() { + srids = new List<int>(); ids = new List<int>(); isNew = true; - srid = 4326; } /// <summary> @@ -73,9 +73,9 @@ public bool isNew { set; get; } /// <summary> - /// 鍧愭爣绯籌D + /// 鍧愭爣绯籌D闆嗗悎 /// </summary> - public int srid { set; get; } + public List<int> srids { set; get; } /// <summary> /// 楂樺害鍋忕Щ閲� diff --git a/ExportMap/cs/LasUtils.cs b/ExportMap/cs/LasUtils.cs index 431c67b..72ba74a 100644 --- a/ExportMap/cs/LasUtils.cs +++ b/ExportMap/cs/LasUtils.cs @@ -43,8 +43,9 @@ string uploadFolder = Tools.GetSetting("uploadFolder"); List<int> ids = new List<int>(); - foreach (SysMeta meta in list) + for (int i = 0, c = list.Count; i < c; i++) { + SysMeta meta = list[i]; string lasPath = Path.Combine(uploadFolder, meta.path); if (!File.Exists(lasPath)) continue; @@ -55,7 +56,8 @@ if (!Directory.Exists(outPath)) Directory.CreateDirectory(outPath); if ("laz" == meta.type) lasPath = toLas(lasPath, Path.Combine(outPath, meta.id + ".las")); - string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, args.srid, args.z); + int srid = args.srids[i]; + string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, srid, args.z); err = Tools.ExecCmd(cmd, false, false); string jsonFile = findTileset(meta, outPath); -- Gitblit v1.9.3