| | |
| | | /// <returns>数据发布ID</returns> |
| | | public static int Generate(XYZArgs args, ref string err) |
| | | { |
| | | string tifFile = Path.Combine(Tool.TempDir, ExportUtil.DateStr + ".txt"); |
| | | string xyzPath = Path.Combine(SGUtils.LFData, "2d\\tiles", args.id.ToString()); |
| | | if (!Directory.Exists(xyzPath)) Directory.CreateDirectory(xyzPath); |
| | | |
| | | List<SysMeta> list = selectMetas(args.ids, "and type in ('tif', 'tiff', 'img')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | int id = list[0].id; |
| | | string tifFile = Path.Combine(Tool.TempDir, ExportUtil.DateStr + ".txt"); |
| | | string xyzPath = Path.Combine(SGUtils.LFData, "2d\\tiles", id.ToString()); |
| | | if (!Directory.Exists(xyzPath)) Directory.CreateDirectory(xyzPath); |
| | | |
| | | WriteText(tifFile, list); |
| | | |
| | |
| | | |
| | | //string newPy = tifFile.Replace(".txt", ".py").Replace("\\", "\\\\"); |
| | | //File.WriteAllText(newPy, pyText); |
| | | |
| | | //string cmd = string.Format("exec(open('{0}', 'r', encoding='utf-8').read()) & exit()", newPy); |
| | | |
| | | err = ExecCmd(cmd); |
| | |
| | | |
| | | string viewFile = Path.Combine(xyzPath, "view.html"); |
| | | |
| | | return File.Exists(viewFile) ? args.id : 0; |
| | | return File.Exists(viewFile) ? id : 0; |
| | | } |
| | | |
| | | /// <summary> |