| | |
| | | public static long DEFAULT_MAX_SIZE = 5L * 1024 * 1024 * 1024; |
| | | |
| | | /// <summary> |
| | | /// 获取发布地址 |
| | | /// 获取发布地址:http://127.0.0.1/ExportMap/terra0?path=3d\terrain\dem\t |
| | | /// </summary> |
| | | public static string GetReleaseUrl(string dircode) |
| | | { |
| | | return "http://{host}/LFData/3d/terrain/" + dircode; |
| | | //return "http://{host}/LFData/3d/terrain/" + dircode; |
| | | return "{host}/ExportMap/terra0?path=3d/terrain/" + dircode; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | string uploadFolder = Tools.GetSetting("uploadFolder"); |
| | | foreach (SysMeta meta in metas) |
| | | { |
| | | if (metsIds.Contains(meta.id)) return PrintInfo("元数据[" + meta.id + "] 已发布。"); |
| | | |
| | | if (metsIds.Contains(meta.id)) |
| | | { |
| | | PrintInfo("元数据[" + meta.id + "] 已发布。"); |
| | | continue; |
| | | } |
| | | string sourceFile = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(sourceFile)) return PrintInfo("元数据[" + meta.id + "] 不存在。"); |
| | | if (!File.Exists(sourceFile)) |
| | | { |
| | | PrintInfo("元数据[" + meta.id + "] 不存在。"); |
| | | continue; |
| | | } |
| | | |
| | | string targetFile = Path.Combine(subPath, meta.name); |
| | | string targetFile = Path.Combine(subPath, meta.id + ".tif"); // meta.path.Split(new string[] { "\\", "//" }, StringSplitOptions.None)[1] |
| | | ConvertRaster(sourceFile, targetFile); |
| | | if (File.Exists(targetFile)) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 补充文件 |
| | | /// </summary> |
| | | private static void Complement(XYZArgs args) |
| | | public static void Complement(XYZArgs args) |
| | | { |
| | | string dirPath = GetTerrainPath(args.dircode); |
| | | string p_0_0 = Path.Combine(dirPath, "0", "0"); |
| | |
| | | string p_0_1 = Path.Combine(dirPath, "0", "1"); |
| | | if (!Directory.Exists(p_0_1)) Directory.CreateDirectory(p_0_1); |
| | | |
| | | string s_0_0_0 = Path.Combine(SGUtils.LFData, "dem", "0", "0", "0.terrain"); |
| | | string s_0 = Tools.BaseDir + "\\Sources\\0.terrain"; |
| | | string d_0_0_0 = Path.Combine(dirPath, "0", "0", "0.terrain"); |
| | | if (!File.Exists(d_0_0_0)) File.Copy(s_0_0_0, d_0_0_0, true); |
| | | if (!File.Exists(d_0_0_0)) File.Copy(s_0, d_0_0_0, true); |
| | | |
| | | string s_0_1_0 = Path.Combine(SGUtils.LFData, "dem", "0", "1", "0.terrain"); |
| | | string d_0_1_0 = Path.Combine(dirPath, "0", "1", "0.terrain"); |
| | | if (!File.Exists(d_0_1_0)) File.Copy(s_0_1_0, d_0_1_0, true); |
| | | if (!File.Exists(d_0_1_0)) File.Copy(s_0, d_0_1_0, true); |
| | | |
| | | string layerJson = Path.Combine(dirPath, "layer.json"); |
| | | string[] lines = File.ReadAllLines(layerJson, Encoding.UTF8); |
| | |
| | | if (!ids.Contains(m.id)) PubDBHelper.InsertMetaPub(m.id, pubid, args.userId); |
| | | } |
| | | string geom = GetPointZ(args); |
| | | PubDBHelper.UpdatePublish(pubid, args.name, args.userId, geom); |
| | | int rows = PubDBHelper.UpdatePublish(pubid, args.name, args.userId, geom); |
| | | |
| | | return pubid; |
| | | } |
| | |
| | | double x = double.Parse(strs[0]); |
| | | double y = double.Parse(strs[1]); |
| | | |
| | | return string.Format("ST_GeomFromText('POINT Z ({0} {1} {2})')", x, y, 12); |
| | | return string.Format("ST_GeomFromText('POINT Z ({0} {1} {2})')", y, x, 12); |
| | | } |
| | | |
| | | /// <summary> |