| | |
| | | Process p = null; |
| | | try |
| | | { |
| | | string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -log D:\\xyz\\auto\\log.txt -NoGui -Exit", modelFile, configFile); |
| | | string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -NoGui -Exit", modelFile, configFile); // -log D:\\xyz\\auto\\log.txt |
| | | LogOut.Info("Args:" + args); |
| | | |
| | | // 启动进程 |
| | | p = Process.Start(RoamerExe, args); |
| | |
| | | private static void WriteText(string file, string str) |
| | | { |
| | | File.WriteAllText(file, str); |
| | | LogOut.Info("JobConfig:" + str); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (isPy) |
| | | { |
| | | si.WriteLine("cd \"C:\\Program Files\\QGIS 3.16\\apps\\Python37\""); |
| | | si.WriteLine("\"C:\\Program Files\\QGIS 3.16\\bin\\qgis_process-qgis-ltr.bat\""); // python-qgis-ltr.bat |
| | | si.WriteLine("\"C:\\Program Files\\QGIS 3.16\\bin\\qgis_process-qgis-ltr.bat\""); |
| | | //si.WriteLine("\"C:\\Program Files\\QGIS 3.16\\bin\\python-qgis-ltr.bat\""); |
| | | //si.WriteLine("exit()"); |
| | | } |
| | | si.WriteLine(cmd); |
| | | si.WriteLine("exit"); |
| | |
| | | |
| | | WriteText(tifFile, list); |
| | | |
| | | 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 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("xyz.qgz", Path.Combine(ExportUtil.SourcesPath, "xyz.qgz")) |
| | | .Replace("D:\\xyz\\zy.txt", tifFile) |
| | | .Replace("D:\\xyz\\tiles\\zy", xyzPath) |
| | | .Replace("=12,", "=" + args.min + ",") |
| | | .Replace("=18,", "=" + args.max + ","); |
| | | |
| | | 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 = Tool.ExecCmd(cmd, true); |
| | | |
| | | if (File.Exists(tifFile)) File.Delete(tifFile); |