| | |
| | | /// </summary> |
| | | public static string GetReleaseUrl(string path) |
| | | { |
| | | return "http://{host}/LFData/" + path.Replace("\\", "/"); |
| | | return "{host}/LFData/" + path.Replace("\\", "/"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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); |
| | | int idx = args.ids.IndexOf(meta.id); |
| | | string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, args.srids[idx], args.zs[idx]); |
| | | SysTask task = TaskDBHelper.CreateTask(args, meta, "LAS", "点云数据(LAS)"); |
| | | err = Tools.ExecCmd(task, cmd, false); |
| | | |
| | | string jsonFile = findTileset(meta, outPath); |
| | | if ("laz" == meta.type && File.Exists(lasPath)) File.Delete(lasPath); |
| | |
| | | string tilerPath = Tools.GetSetting("tilerPath"); |
| | | |
| | | string cmd = string.Format("{0}\\laszip64.exe -i \"{1}\" -o \"{2}\"", tilerPath, lazPath, lasPath); |
| | | Tools.ExecCmd(cmd, false, false); |
| | | Tools.ExecCmd(new List<string> { cmd }); |
| | | |
| | | return lasPath; |
| | | } |
| | |
| | | /// </summary> |
| | | private static int InsertToDB(SysMeta meta, XYZArgs args, string path) |
| | | { |
| | | if (PubDBHelper.IsPublish(meta.id)) return 1; |
| | | //if (PubDBHelper.IsPublish(meta.id)) return 1; |
| | | int pubid = PubDBHelper.GetPushlishId(meta.id); |
| | | if (pubid > 0) |
| | | { |
| | | PubDBHelper.UpdatePublish(pubid, meta.name, args.userId, null); |
| | | return pubid; |
| | | } |
| | | |
| | | SysPublish sys = Tools.NewPublish(meta, args, GetReleaseUrl(path), path); |
| | | |
| | | int pubid = PubDBHelper.InsertPublish(sys); |
| | | pubid = PubDBHelper.InsertPublish(sys); |
| | | if (pubid > 0) |
| | | { |
| | | sys.id = pubid; |
| | |
| | | List<int> ids = new List<int>(); |
| | | foreach (SysMeta meta in list) |
| | | { |
| | | string lasPath = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(lasPath)) continue; |
| | | |
| | | int epsg = 0; |
| | | try |
| | | { |
| | | epsg = Tools.get_las_cs(lasPath.Replace("\\", "/")); |
| | | string lasPath = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(lasPath)) |
| | | { |
| | | ids.Add(-1); |
| | | continue; |
| | | } |
| | | |
| | | int epsg = Tools.get_las_cs(lasPath.Replace("\\", "/")); |
| | | ids.Add(epsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); |
| | | epsg = -1; |
| | | ids.Add(-1); |
| | | } |
| | | ids.Add(epsg); |
| | | } |
| | | |
| | | return ids; |