| | |
| | | string viewFile = Path.Combine(xyzPath, "view.html"); |
| | | if (File.Exists(viewFile)) |
| | | { |
| | | string path = ""; |
| | | string path = "2d\\tiles" + "\\" + args.dircode; |
| | | InsertToDB(list, args, path); |
| | | return 1; |
| | | } |
| | |
| | | int pubid = PubDBHelper.InsertPublish(sys); |
| | | if (pubid > 0) |
| | | { |
| | | //PubDBHelper.InsertMetaPub(meta.id, pubid); |
| | | foreach (SysMeta meta in metas) |
| | | { |
| | | PubDBHelper.InsertMetaPub(meta.id, pubid, args.userId); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | sp.max = args.max; |
| | | sp.json = null; |
| | | sp.create_user = args.userId; |
| | | sp.geom = null; |
| | | sp.geom = GetPointZ(args); |
| | | sp.bak = null; |
| | | |
| | | return sp; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取中心点 |
| | | /// </summary> |
| | | private static string GetPointZ(XYZArgs args) |
| | | { |
| | | string viewFile = Path.Combine(SGUtils.LFData, "2d\\tiles", args.dircode, "view.html"); |
| | | if (!File.Exists(viewFile)) return null; |
| | | |
| | | string str = File.ReadAllText(viewFile); |
| | | int start = str.IndexOf(".setView([") + ".setView([".Length; |
| | | int end = str.IndexOf(");", start); |
| | | |
| | | string coords = str.Substring(start, end - start).Replace("]", "").Replace(" ", ""); |
| | | string[] strs = coords.Split(new char[] { ',' }); |
| | | |
| | | return string.Format("ST_GeomFromText('POINT Z ({0} {1} {2})')", strs[0], strs[1], strs[2]); |
| | | } |
| | | } |
| | | } |