| | |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | string dateStr = ExportUtil.DateStr; |
| | | string batFile = Path.Combine(BatPath, dateStr + ".bat"); |
| | | //string batFile = Path.Combine(BatPath, dateStr + ".bat"); |
| | | string tifFile = Path.Combine(Tools.TempDir, ExportUtil.DateStr + ".txt"); |
| | | string xyzPath = Path.Combine(SGUtils.LFData, "2d\\tiles", args.dircode); |
| | | if (!Directory.Exists(xyzPath)) Directory.CreateDirectory(xyzPath); |
| | |
| | | |
| | | string cmd = string.Format("python \"{0}\" -qgz {1} -file \"{2}\" -out \"{3}\" -min {4} -max {5}", PyFile, Qgz, tifFile, xyzPath, args.min, args.max); |
| | | |
| | | //string pyText = File.ReadAllText(PyFile); |
| | | //pyText = pyText |
| | | // .Replace(@"E:\terrait\TianJin\ExportMap\ExportMap\Sources\xyz.qgz", Qgz) |
| | | // .Replace(@"D:\xyz\zy.txt", tifFile) |
| | | // .Replace(@"D:\xyz\tiles\zy", xyzPath) |
| | | // .Replace("=12,", "=" + args.min + ",") |
| | | // .Replace("=15,", "=" + args.max + ","); |
| | | //err = Tools.ExecCmd(GetCmds(batFile, cmd)); |
| | | err = Tools.ExecCmd(cmd, true); |
| | | |
| | | //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); |
| | | |
| | | //List<string> cmds = GetCmds(cmd); |
| | | //err = Tools.ExecCmd(cmds); |
| | | |
| | | List<string> cmds = GetCmds(batFile, cmd); |
| | | err = Tools.ExecCmd(cmds); |
| | | |
| | | //if (File.Exists(batFile)) File.Delete(batFile); |
| | | if (File.Exists(tifFile)) File.Delete(tifFile); |
| | | if (File.Exists(batFile)) File.Delete(batFile); |
| | | |
| | | string viewFile = Path.Combine(xyzPath, "view.html"); |
| | | if (File.Exists(viewFile)) |
| | |
| | | string uploadFolder = Tools.GetSetting("uploadFolder"); |
| | | |
| | | List<string> files = new List<string>(); |
| | | //foreach (SysMeta meta in list) |
| | | //{ |
| | | // string filePath = Path.Combine(uploadFolder, meta.path); |
| | | // if (File.Exists(filePath)) files.Add(filePath); |
| | | //} |
| | | files.Add(@"E:\01.Data\33.DOM\2.大庆DOM\5154.50-415.50.tif"); |
| | | files.Add(@"E:\01.Data\33.DOM\2.大庆DOM\5154.50-416.00.tif"); |
| | | foreach (SysMeta meta in list) |
| | | { |
| | | string filePath = Path.Combine(uploadFolder, meta.path); |
| | | if (File.Exists(filePath)) files.Add(filePath); |
| | | } |
| | | //files.Add(@"E:\01.Data\33.DOM\2.大庆DOM\5154.50-415.50.tif"); |
| | | //files.Add(@"E:\01.Data\33.DOM\2.大庆DOM\5154.50-416.00.tif"); |
| | | string str = string.Join("\n", files); |
| | | |
| | | File.WriteAllText(file, str); |