| | |
| | | public XYZArgs() |
| | | { |
| | | ids = new List<int>(); |
| | | isNew = true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// 元数据ID集合 |
| | | /// </summary> |
| | | public List<int> ids { set; get; } |
| | | |
| | | /// <summary> |
| | | /// 是/否全新发布 |
| | | /// </summary> |
| | | public bool isNew { set; get; } |
| | | } |
| | | } |
| | |
| | | string outPath = Path.Combine(tilesFolder, meta.type, meta.id.ToString()); |
| | | string jsonFile = Path.Combine(outPath, "tileset.json"); |
| | | |
| | | if (args.isNew && Directory.Exists(outPath)) Tools.DelPath(outPath); |
| | | if (!Directory.Exists(outPath)) Directory.CreateDirectory(outPath); |
| | | if (File.Exists(jsonFile)) File.Delete(jsonFile); |
| | | |
| | |
| | | if (null == metas || metas.Count == 0) return null; |
| | | |
| | | string dirPath = GetTerrainPath(args.dircode); |
| | | if (Directory.Exists(dirPath)) Tools.DelPath(dirPath); |
| | | if (args.isNew && Directory.Exists(dirPath)) Tools.DelPath(dirPath); |
| | | |
| | | tifFile = Merge(metas, args, ref err); |
| | | if (!File.Exists(tifFile)) return null; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 生成高程切片 |
| | | /// 生成高程切片 * |
| | | /// </summary> |
| | | private static void Generate(XYZArgs args, string tifFile, ref string err) |
| | | { |
| | |
| | | //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 (args.isNew && Directory.Exists(xyzPath)) Tools.DelPath(xyzPath); |
| | | if (!Directory.Exists(xyzPath)) Directory.CreateDirectory(xyzPath); |
| | | |
| | | WriteText(tifFile, list); |