internal List <Datarow> DoQueryFileTableData(XmlNodeList nodelist, string tableName, MapExtent extent) { Datatable table = GetDatatable(tableName); if (table != null) { switch (table.TableType) { case DatatableType.Null: break; case DatatableType.Point: return(DoParserPointData(nodelist, tableName, extent)); case DatatableType.Raster: return(DoParserRasterData(nodelist, tableName, extent)); case DatatableType.Line: return(DoParserLineData(nodelist, tableName, extent)); case DatatableType.Polygon: return(DoParserPolygonData(nodelist, tableName, extent)); default: break; } } return(new List <Datarow>()); }
public static Datatable GetTable(Workspace.Workspace ws, Layer layer) { LsMap.Data.Datasource ds = ws.GetDatasource(layer.DatasourceName); if (ds != null) { LsMap.Data.Datatable dt = ws.GetDatatable(ds, layer.DatatableName); return(dt); } return(null); }
internal void DoOpenFileDataSrc() { //数据库中所有数据 string[] allfiles = System.IO.Directory.GetFiles(_datasourcePath); if (allfiles == null || allfiles.Length == 0) { return; } //表文件 IEnumerable <string> lsdtfiles = allfiles.Where(delegate(string s) { return(s.EndsWith(".lsdt")); }); if (lsdtfiles.Count() == 0) { return; } foreach (string item in lsdtfiles) { XmlDocument document = new XmlDocument(); document.Load(item); XmlNode root = document.SelectSingleNode("datas"); if (root == null) { continue; } XmlAttribute attritype = root.Attributes["type"]; if (attritype == null) { continue; } string datatype = attritype.Value; DatatableType type = DatatableType.Null; if (!Enum.TryParse <DatatableType>(datatype, true, out type)) { continue; } string tablename = System.IO.Path.GetFileNameWithoutExtension(item); Datatable dataTable = new Datatable(tablename, type); dataTable.Datasource = this; this.Tables.Add(dataTable); // XmlNodeList nodelist = document.SelectNodes("datas/data"); // // if (nodelist != null && nodelist.Count > 0) // { // DoParserFileTableData(nodelist, dataTable, item); // } } }
public Layer(LsMap.Data.Datasource datasource, LsMap.Data.Datatable datatable) { _datasource = datasource; _datatable = datatable; _layerID = ++LAYERID; }