| | |
| | | /// </summary> |
| | | /// <param name="args">XYZ参数</param> |
| | | /// <param name="err">错误信息</param> |
| | | /// <returns>数据发布ID</returns> |
| | | public static int Generate(XYZArgs args, ref string err) |
| | | /// <returns>数据发布ID集合</returns> |
| | | public static List<int> Generate(XYZArgs args, ref string err) |
| | | { |
| | | List<SysMeta> list = SelectMetas(args.ids, "and type in ('tif', 'tiff', 'img')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | if (null == list || list.Count == 0) return null; |
| | | |
| | | string dateStr = ExportUtil.DateStr; |
| | | //string batFile = Path.Combine(BatPath, dateStr + ".bat"); |
| | |
| | | //if (File.Exists(batFile)) File.Delete(batFile); |
| | | if (File.Exists(tifFile)) File.Delete(tifFile); |
| | | |
| | | List<int> ids = new List<int>(); |
| | | string viewFile = Path.Combine(xyzPath, "view.html"); |
| | | if (File.Exists(viewFile)) |
| | | { |
| | | string path = "2d\\tiles" + "\\" + args.dircode; |
| | | InsertToDB(list, args, path); |
| | | return 1; |
| | | int pubid = InsertToDB(list, args, path); |
| | | |
| | | if (pubid > 0) ids.Add(pubid); |
| | | } |
| | | |
| | | return 0; |
| | | return ids; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 插入数据库 |
| | | /// </summary> |
| | | private static void InsertToDB(List<SysMeta> metas, XYZArgs args, string path) |
| | | private static int InsertToDB(List<SysMeta> metas, XYZArgs args, string path) |
| | | { |
| | | if (PubDBHelper.IsPublish(args.dircode)) return; |
| | | if (PubDBHelper.IsPublish(args.dircode)) return 0; |
| | | |
| | | SysPublish sys = NewPublish(metas[0], args); |
| | | sys.path = path; |
| | |
| | | PubDBHelper.InsertMetaPub(meta.id, pubid, args.userId); |
| | | } |
| | | } |
| | | |
| | | return pubid; |
| | | } |
| | | |
| | | /// <summary> |