| | |
| | | /// <summary> |
| | | /// 默认最大文件大小:5GB |
| | | /// </summary> |
| | | public static long DDEFAULT_MAX_SIZE = 5L * 1024 * 1024 * 1024; |
| | | public static long DEFAULT_MAX_SIZE = 5L * 1024 * 1024 * 1024; |
| | | |
| | | /// <summary> |
| | | /// 获取Python文件 |
| | |
| | | /// </summary> |
| | | public static string GetReleaseUrl(string dircode) |
| | | { |
| | | return "http://{host}/LFData/3d/terrain/" + dircode; |
| | | return "{host}/LFData/3d/terrain/" + dircode; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | try |
| | | { |
| | | List<SysMeta> metas = XYZUtils.SelectMetas(args.ids, "and type in ('tif', 'tiff')"); |
| | | if (null == metas || metas.Count == 0) return null; |
| | | if (null == metas || metas.Count == 0) |
| | | { |
| | | LogOut.Info("TerraUtils:找不到元数据。"); |
| | | return null; |
| | | } |
| | | |
| | | string dirPath = GetTerrainPath(args.dircode); |
| | | //if (Directory.Exists(dirPath)) Tools.DelPath(dirPath); // 已存在的,删除 |
| | | |
| | | tifFile = Merge(metas, args, ref err); |
| | | if (!File.Exists(tifFile)) return null; |
| | | if (!File.Exists(tifFile)) |
| | | { |
| | | LogOut.Info("TerraUtils:找不到tifFile数据。"); |
| | | return null; |
| | | } |
| | | |
| | | string json = Path.Combine(dirPath, "layer.json"); |
| | | if (File.Exists(json)) File.Delete(json); |
| | | //Generate(args, tifFile, ref err); |
| | | CreateTerrain(args, tifFile, ref err); |
| | | |
| | | if (!File.Exists(json)) return null; |
| | | if (!File.Exists(json)) |
| | | { |
| | | LogOut.Info("TerraUtils:找不到layer.json文件。"); |
| | | return null; |
| | | } |
| | | Complement(args); |
| | | |
| | | List<int> ids = new List<int>(); |
| | |
| | | err = Tools.ExecCmd(task, cmd, true); |
| | | |
| | | task = TaskDBHelper.SelectById(task.id); |
| | | if (null == task || task.status != 2) return string.Empty; |
| | | if (null == task || task.status != 2) LogOut.Info("TerraUtils:任务为空或状态不为2。"); |
| | | |
| | | return tifFile; |
| | | } |
| | |
| | | private static int GetTerrainMaxLevel(XYZArgs args, string tifFile) |
| | | { |
| | | FileInfo fi = new FileInfo(tifFile); |
| | | if (fi.Length > DDEFAULT_MAX_SIZE) return TERRAIN_MAX_LEVEL; |
| | | if (fi.Length > DEFAULT_MAX_SIZE) return TERRAIN_MAX_LEVEL; |
| | | |
| | | string ctbPath = Tools.GetSetting("ctbPath"); |
| | | string dirPath = GetTerrainPath(args.dircode); |