| | |
| | | vd.Meta = new SysMeta(); |
| | | vd.Meta.name = fi.Name; |
| | | //vd.Meta.dirid = Common.DirId; |
| | | vd.Meta.depid = 1; |
| | | //vd.Meta.depid = 1; |
| | | vd.Meta.verid = 0; |
| | | vd.Meta.type = fi.Extension.ToLower().Replace(".", ""); |
| | | vd.Meta.sizes = Tools.SizeToMb(fi.Length); |
| | |
| | | SysMeta mf = new SysMeta(); |
| | | mf.eventid = Guid.NewGuid().ToString(); |
| | | mf.metaid = 0; |
| | | mf.dirid = vd.Meta.dirid; |
| | | mf.depid = vd.Meta.depid; |
| | | //mf.dirid = vd.Meta.dirid; |
| | | //mf.depid = vd.Meta.depid; |
| | | mf.verid = vd.Meta.verid; |
| | | mf.name = vd.Meta.name; |
| | | mf.type = vd.Meta.type; |
| | |
| | | using System; |
| | | using DataLoader.Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DataLoader.CS |
| | | { |
| | | /// <summary> |
| | | /// 元数据帮助类 |
| | | /// </summary> |
| | | public class MetaHelper |
| | | { |
| | | // id, eventid, metaid, verid, name, type, guid, path, sizes, tab, rows, create_user, create_time, update_user, update_time, bak, geom, layer, depcode, dircode, ismeta, sensortype, acq_time, resolution, gridsize, coor_sys, epsg, h_datum, mata_type, bands, band_type, ct |
| | | public static string insertSql = "insert into lf.sys_meta (eventid, metaid, verid, name, type, guid, path, sizes, tab, rows, create_user, create_time, bak, geom, layer, depcode, dircode, ismeta, sensortype, acq_time, resolution, gridsize, coor_sys, epsg, h_datum, mata_type, bands, band_type, ct) values (@eventid, @metaid, @verid, @name, @type, @guid, @path, @sizes, @tab, @rows, @create_user, now(), @bak, @geom, @layer, @depcode, @dircode, @ismeta, @sensortype, @acq_time, @resolution, @gridsize, @coor_sys, @epsg, @h_datum, @mata_type, @bands, @band_type, @ct) returning id"; |
| | | |
| | | /// <summary> |
| | | /// 插入数据 |
| | | /// </summary> |
| | | public int Insert(List<SysMeta> list) |
| | | { |
| | | PostgreHelper db = Tools.DBHelper; |
| | | |
| | | int count = 0; |
| | | foreach (SysMeta meta in list) |
| | | { |
| | | List<DbParameter> args = Tools.GetParams<SysMeta>(insertSql, meta) |
| | | ; |
| | | int id = db.GetIntScalar(insertSql, args.ToArray()); |
| | | if (id > 0) count++; |
| | | } |
| | | |
| | | return count; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using OSGeo.GDAL; |
| | | using System; |
| | | using System.Runtime.InteropServices.ComTypes; |
| | | using System.Security.Policy; |
| | | |
| | | namespace DataLoader.Model |
| | | { |
| | |
| | | /// </summary> |
| | | public class SysMeta |
| | | { |
| | | public SysMeta() { } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int id { set; get; } |
| | | |
| | | public string eventid { set; get; } |
| | | |
| | | public int metaid { set; get; } |
| | | |
| | | public int dirid { set; get; } |
| | | |
| | | public int depid { set; get; } |
| | | |
| | | public int verid { set; get; } |
| | | |
| | |
| | | |
| | | public string geom { set; get; } |
| | | |
| | | public SysMeta() { } |
| | | public string layer { set; get; } |
| | | |
| | | public string depcode { set; get; } |
| | | |
| | | public string dircode { set; get; } |
| | | |
| | | public int ismeta { set; get; } |
| | | |
| | | public string sensortype { set; get; } |
| | | |
| | | public DateTime acq_time { set; get; } |
| | | |
| | | public string resolution { set; get; } |
| | | |
| | | public string gridsize { set; get; } |
| | | |
| | | public string coor_sys { set; get; } |
| | | |
| | | public string epsg { set; get; } |
| | | |
| | | public string h_datum { set; get; } |
| | | |
| | | public string mata_type { set; get; } |
| | | |
| | | public string bands { set; get; } |
| | | |
| | | public string band_type { set; get; } |
| | | |
| | | public string ct { set; get; } |
| | | } |
| | | } |