From bc425adbda376e5ad30f269c0a9ebae2d12de44f Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 22 五月 2023 14:25:46 +0800 Subject: [PATCH] 1 --- ExportMap/cs/TerraUtils.cs | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/ExportMap/cs/TerraUtils.cs b/ExportMap/cs/TerraUtils.cs index e043bf9..993d961 100644 --- a/ExportMap/cs/TerraUtils.cs +++ b/ExportMap/cs/TerraUtils.cs @@ -258,6 +258,7 @@ meta.name = args.name; SysPublish sys = Tools.NewPublish(meta, args, GetReleaseUrl(args.dircode), "3d\\terrain\\" + args.dircode); + sys.geom = GetPointZ(args); int pubid = PubDBHelper.InsertPublish(sys); if (pubid > 0) @@ -277,5 +278,33 @@ return pubid; } + + /// <summary> + /// 鑾峰彇涓績鐐� + /// </summary> + private static string GetPointZ(XYZArgs args) + { + string dirPath = GetTerrainPath(args.dircode); + string txtFile = Path.Combine(dirPath, args.dircode + "_cs.txt"); + if (!File.Exists(txtFile)) return null; + + string[] strs = File.ReadAllLines(txtFile, Encoding.UTF8); + File.Delete(txtFile); + + if (null == strs || strs.Length == 0) return null; + string[] str = strs[0].Split(new string[] { ", " }, StringSplitOptions.None); + + int i = 18; + for (; i > -1; i--) + { + string path = Path.Combine(dirPath, i.ToString()); + if (Directory.Exists(path)) + { + break; + } + } + + return string.Format("ST_GeomFromText('POINT Z ({0} {1} {2})')", str[1], str[0], i); + } } } -- Gitblit v1.9.3