| | |
| | | List<SysMeta> metas = XYZUtils.SelectMetas(args.ids, "and type in ('tif', 'tiff')"); |
| | | if (null == metas || metas.Count == 0) 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; |
| | | |
| | | Generate(args, tifFile, ref err); |
| | | //Generate(args, tifFile, ref err); |
| | | CreateTerrain(args, tifFile, ref err); |
| | | |
| | | string path = GetTerrainPath(args.dircode); |
| | | string json = Path.Combine(path, "layer.json"); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建高程切片 |
| | | /// </summary> |
| | | private static void CreateTerrain(XYZArgs args, string tifFile, ref string err) |
| | | { |
| | | string ctbPath = Tools.GetSetting("ctbPath"); |
| | | string dirPath = GetTerrainPath(args.dircode); |
| | | |
| | | string gdal_data = string.Format("set GDAL_DATA={0}\\data", ctbPath); |
| | | string createMesh = string.Format("{0}\\ctb-tile.exe -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); |
| | | string createLayer = string.Format("{0}\\ctb-tile.exe -l -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); |
| | | |
| | | List<string> list = new List<string>() { gdal_data, createMesh, createLayer }; |
| | | err = Tools.ExecCmd(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 插入数据库 |
| | | /// </summary> |
| | | private static int InsertToDB(List<SysMeta> metas, XYZArgs args) |