| | |
| | | /// <summary> |
| | | /// 获取发布地址 |
| | | /// </summary> |
| | | public static string GetReleaseUrl(SysMeta meta) |
| | | public static string GetReleaseUrl(string path) |
| | | { |
| | | return "http://{host}/LFData/3d/3dtiles/las/" + meta.id + "/tileset.json"; |
| | | return "http://{host}/LFData/" + path.Replace("\\", "/"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | meta.ismeta = 0; // 0-倾斜摄影数据 |
| | | string outPath = GetPath(meta.id); |
| | | string jsonFile = Path.Combine(outPath, "tileset.json"); |
| | | |
| | | if (args.isNew && Directory.Exists(outPath)) Tools.DelPath(outPath); |
| | | if (Directory.Exists(outPath)) Tools.DelPath(outPath); |
| | | if (!Directory.Exists(outPath)) Directory.CreateDirectory(outPath); |
| | | if (File.Exists(jsonFile)) File.Delete(jsonFile); |
| | | |
| | | 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 (File.Exists(jsonFile)) |
| | | { |
| | | string path = jsonFile.Replace(Tools.GetSetting("lfData") + "\\", ""); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找tileset.json |
| | | /// </summary> |
| | | private static string findTileset(string path) |
| | | { |
| | | DirectoryInfo di = new DirectoryInfo(path); |
| | | FileInfo[] fis = di.GetFiles("tileset.json", SearchOption.AllDirectories); |
| | | |
| | | return null == fis || 0 == fis.Length ? null : fis[0].FullName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 插入数据库 |
| | | /// </summary> |
| | | private static int InsertToDB(SysMeta meta, XYZArgs args, string path) |
| | | { |
| | | if (PubDBHelper.IsPublish(meta.id)) return 0; |
| | | |
| | | SysPublish sys = Tools.NewPublish(meta, args, GetReleaseUrl(meta), path); |
| | | SysPublish sys = Tools.NewPublish(meta, args, GetReleaseUrl(path), path); |
| | | |
| | | int pubid = PubDBHelper.InsertPublish(sys); |
| | | if (pubid > 0) |
| | |
| | | |
| | | // 测试Las |
| | | function toLas() { |
| | | var data = { token: token, ids: [7188], depcode: "00", dircode: "0C", userId: 1, name: "HL_point_cloud_part_1.las" }; |
| | | var data = { token: token, ids: [7188], depcode: "00", dircode: "0C", userId: 1, name: "HL_point_cloud_part_1.las", 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); |