管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-05-16 2cc7b6edb45d439d748a7300089755b03aef97a7
1
已修改2个文件
33 ■■■■■ 文件已修改
ExportMap/cs/TerraUtils.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/export.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/TerraUtils.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
namespace ExportMap.cs
@@ -105,6 +106,8 @@
                string path = GetTerrainPath(args.dircode);
                string json = Path.Combine(path, "layer.json");
                if (!File.Exists(json)) return null;
                Complement(args);
                List<int> ids = new List<int>();
                int pubid = InsertToDB(metas, args);
@@ -217,6 +220,34 @@
        }
        /// <summary>
        /// 补充文件
        /// </summary>
        private static void Complement(XYZArgs args)
        {
            string dirPath = GetTerrainPath(args.dircode);
            string p_0_0 = Path.Combine(dirPath, "0", "0");
            if (!Directory.Exists(p_0_0)) Directory.CreateDirectory(p_0_0);
            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);
            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);
            string layerJson = Path.Combine(dirPath, "layer.json");
            string[] lines = File.ReadAllLines(layerJson, Encoding.UTF8);
            lines[12] = "    [ {\"endX\":1,\"endY\":0,\"startX\":0,\"startY\":0}],[{\"endX\":3,\"endY\":1,\"startX\":2,\"startY\":1} ]";
            File.WriteAllLines(layerJson, lines, Encoding.UTF8);
        }
        /// <summary>
        /// 插入数据库
        /// </summary>
        private static int InsertToDB(List<SysMeta> metas, XYZArgs args)
ExportMap/export.html
@@ -5,7 +5,7 @@
  <title></title>
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var token = "d12b3854-17c1-46c1-8435-22b1c5892fe7";
    var token = "82e13dc3-3573-4506-9d70-02f285878bfa";
    // Ajax
    function ajax(url, type, data, dataType, contentType, fn) {