管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-06-22 4d7c8b075ac8924ccf9a644e6e1bb3859c49aa32
1
已修改2个文件
28 ■■■■■ 文件已修改
ExportMap/cs/LasUtils.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/export.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/LasUtils.cs
@@ -53,11 +53,13 @@
                    if (Directory.Exists(outPath)) Tools.DelPath(outPath);
                    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);
                    err = Tools.ExecCmd(cmd, false, false);
                    string jsonFile = findTileset(outPath);
                    if ("laz" == meta.type && File.Exists(lasPath)) File.Delete(lasPath);
                    if (File.Exists(jsonFile))
                    {
                        string path = jsonFile.Replace(Tools.GetSetting("lfData") + "\\", "");
@@ -77,6 +79,20 @@
        }
        /// <summary>
        /// laz 转换为 las
        /// </summary>
        private static string toLas(string lazPath, string outPath)
        {
            string lasPath = outPath.Replace("laz", "laz");
            string tilerPath = Tools.GetSetting("tilerPath");
            string cmd = string.Format("{0}\\laszip64.exe -i \"{1}\" -o \"{2}\"", tilerPath, lazPath, lasPath);
            Tools.ExecCmd(cmd, false, false);
            return lasPath;
        }
        /// <summary>
        /// 查找tileset.json
        /// </summary>
        private static string findTileset(string path)
ExportMap/export.html
@@ -5,7 +5,7 @@
  <title></title>
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var token = "74fca142-b0cd-4ecb-965b-6b51b8866ec4";
    var token = "b1ad2b8b-2fe5-440d-b072-88eb070a6462";
    // Ajax
    function ajax(url, type, data, dataType, contentType, fn) {
@@ -146,6 +146,15 @@
        console.log(rs);
      });
    }
    // 测试Laz
    function toLaz(){
      var data = { token: token, ids: [7190], depcode: "00", dircode: "0C", userId: 1, name: "577.laz", srid: 4548, z: 0 };
      ajax("Convert/ToLas", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
  </script>
</head>
<body>
@@ -169,5 +178,6 @@
  <input type="button" value="测试Terra" onclick="toTerra();" />
  <input type="button" value="测试OSGB" onclick="toOsgb();" />
  <input type="button" value="测试Las" onclick="toLas();" />
  <input type="button" value="测试Laz" onclick="toLaz();" />
</body>
</html>