| | |
| | | } |
| | | if (checkDir && string.IsNullOrWhiteSpace(args.dircode)) |
| | | { |
| | | return ResponseMsg<string>.fail("单位代码不能为空"); |
| | | return ResponseMsg<string>.fail("目录代码不能为空"); |
| | | } |
| | | |
| | | return null; |
| | |
| | | string uploadFolder = Tools.GetSetting("uploadFolder"); |
| | | |
| | | List<int> ids = new List<int>(); |
| | | for (int i = 0, c = list.Count; i < c; i++) |
| | | foreach (SysMeta meta in list) |
| | | { |
| | | SysMeta meta = list[i]; |
| | | string lasPath = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(lasPath)) continue; |
| | | |
| | |
| | | if (!Directory.Exists(outPath)) Directory.CreateDirectory(outPath); |
| | | if ("laz" == meta.type) lasPath = toLas(lasPath, Path.Combine(outPath, meta.id + ".las")); |
| | | |
| | | int srid = args.srids[i]; |
| | | string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, srid, args.z); |
| | | 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.z); |
| | | err = Tools.ExecCmd(cmd, false, false); |
| | | |
| | | string jsonFile = findTileset(meta, outPath); |
| | |
| | | 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; |
| | |
| | | /// </summary> |
| | | public static List<SysMeta> SelectMetas(List<int> ids, string types = "") |
| | | { |
| | | string sql = string.Format("select a.*, fn_get_fullname(dircode, 2) dirname from lf.sys_meta a where id in ({0}) {1} order by id", string.Join(",", ids), types); |
| | | string sql = string.Format("select a.*, fn_get_fullname(dircode, 2) dirname from lf.sys_meta a where id in ({0}) {1} order by id desc", string.Join(",", ids), types); |
| | | DataTable dt = Tools.DBHelper.GetDataTable(sql); |
| | | List<SysMeta> list = ModelHandler.FillModel<SysMeta>(dt); |
| | | |
| | |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <script src="js/jquery.1.12.4.js"></script> |
| | | <script> |
| | | var token = "673e4e0f-5a6e-49e6-bb04-d5991cbc3b7f"; |
| | | var token = "0de31b49-1957-4e15-8258-965a35ea56cb"; |
| | | |
| | | // Ajax |
| | | function ajax(url, type, data, dataType, contentType, fn) { |
| | |
| | | |
| | | // 读取Las坐标系 |
| | | function ReadLasCs() { |
| | | var data = { token: token, ids: [10285, 10481, 10456, 10483], dircode: "00" }; |
| | | var data = { token: token, ids: [10483, 10481, 10456, 10285], dircode: "00" }; |
| | | ajax("Convert/ReadLasCs", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |