From 15748d6b16b43f0d3570ee8956189d5e6ff64db7 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 24 七月 2023 16:41:31 +0800 Subject: [PATCH] 1 --- ExportMap/cs/TerraUtils.cs | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ExportMap/cs/TerraUtils.cs b/ExportMap/cs/TerraUtils.cs index 0cad744..990fd6e 100644 --- a/ExportMap/cs/TerraUtils.cs +++ b/ExportMap/cs/TerraUtils.cs @@ -95,17 +95,17 @@ if (null == metas || metas.Count == 0) return null; string dirPath = GetTerrainPath(args.dircode); - if (Directory.Exists(dirPath)) Tools.DelPath(dirPath); + //if (Directory.Exists(dirPath)) Tools.DelPath(dirPath); // 宸插瓨鍦ㄧ殑锛屽垹闄� tifFile = Merge(metas, args, ref err); if (!File.Exists(tifFile)) return null; + string json = Path.Combine(dirPath, "layer.json"); + if (File.Exists(json)) File.Delete(json); //Generate(args, tifFile, ref err); CreateTerrain(args, tifFile, ref err); - string json = Path.Combine(dirPath, "layer.json"); if (!File.Exists(json)) return null; - Complement(args); List<int> ids = new List<int>(); @@ -205,7 +205,7 @@ string dirPath = GetTerrainPath(args.dircode); string gdal_data = string.Format("set GDAL_DATA={0}\\data", ctbPath); - string createMesh = string.Format("{0}\\ctb-tile.exe -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); + string createMesh = string.Format("{0}\\ctb-tile.exe -R -C -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); string createLayer = string.Format("{0}\\ctb-tile.exe -l -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); List<string> list = new List<string>() { gdal_data, createMesh, createLayer }; @@ -224,14 +224,13 @@ string p_0_1 = Path.Combine(dirPath, "0", "1"); if (!Directory.Exists(p_0_1)) Directory.CreateDirectory(p_0_1); - string s_0_0_0 = Path.Combine(SGUtils.LFData, "dem", "0", "0", "0.terrain"); string d_0_0_0 = Path.Combine(dirPath, "0", "0", "0.terrain"); - File.Copy(s_0_0_0, d_0_0_0, true); + if (!File.Exists(d_0_0_0)) File.Copy(s_0_0_0, d_0_0_0, true); string s_0_1_0 = Path.Combine(SGUtils.LFData, "dem", "0", "1", "0.terrain"); string d_0_1_0 = Path.Combine(dirPath, "0", "1", "0.terrain"); - File.Copy(s_0_1_0, d_0_1_0, true); + if (!File.Exists(d_0_1_0)) File.Copy(s_0_1_0, d_0_1_0, true); string layerJson = Path.Combine(dirPath, "layer.json"); string[] lines = File.ReadAllLines(layerJson, Encoding.UTF8); -- Gitblit v1.9.3