예제 #1
0
 public CatalogEntityClassBase(string connString)
 {
     _dbConnection = DbConnectionFactory.CreateDbConnection(connString);
     _dbConnection.Open();
     _connString = connString;
     _adapter    = DiffDbAdapterFactory.GetDiffDbAdapter(_dbConnection);
 }
예제 #2
0
 private string[] GetFieldsBySpatialFetClass(SpatialFeatureClass spatialFeatureClass)
 {
     using (IDbConnection dbConn = DbConnectionFactory.CreateDbConnection(_connectionString))
     {
         dbConn.Open();
         DiffDbAdapter             _adapter   = DiffDbAdapterFactory.GetDiffDbAdapter(dbConn);
         string                    shapeField = null;
         string                    oidfield   = null;
         Dictionary <string, Type> fields     = _adapter.GetFieldsOfTable(dbConn, spatialFeatureClass.DataTable, out shapeField, out oidfield);
         return(fields.Keys.ToArray());
     }
 }
예제 #3
0
 public void Import(Feature[] features, MetaFeatureClassDef fetclassdef, IDbConnection dbConnection, IProgressTracker tracker, params object[] args)
 {
     if (features == null)
     {
         throw new ArgumentNullException("features为空。");
     }
     if (dbConnection == null)
     {
         throw new ArgumentNullException("dbConnection为空。");
     }
     if (fetclassdef == null)
     {
         throw new ArgumentNullException("feactureClass.Name为空,无法确定数据表名。");
     }
     _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(dbConnection);
     string[] fields = features[0].FieldNames;
     Import(fetclassdef, fields, features, dbConnection, tracker);
 }
예제 #4
0
 public FetClassWriterDb(ICatalogItem locationItem)
 {
     if (locationItem is CatalogDatabaseConn)
     {
         _dbConn = DbConnectionFactory.CreateDbConnection(((locationItem as CatalogDatabaseConn).Tag as SpatialDatabaseConn).ConnectionString);
     }
     else if (locationItem is CatalogFeatureDataset)
     {
         CatalogFeatureDataset cfd = locationItem as CatalogFeatureDataset;
         SpatialFeatureDataset sfd = cfd.Tag as SpatialFeatureDataset;
         _dbConn        = DbConnectionFactory.CreateDbConnection((sfd as CatalogEntityBase)._connString);
         _datasetId     = sfd.Id;
         _dstSpatialRef = SpatialReferenceFactory.GetSpatialReferenceByWKT(sfd.SpatialRef, enumWKTSource.EsriPrjFile);
     }
     else
     {
         throw new NotSupportedException("类型为\"" + locationItem + "\"的位置暂不支持写。");
     }
     _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(_dbConn);
     _dbConn.Open();
 }
예제 #5
0
 public void Dispose()
 {
     _adapter = null;
 }
예제 #6
0
 public SpatialDbBuilder(IDbConnection connection)
 {
     _adapter = DiffDbAdapterFactory.GetDiffDbAdapter(connection);
 }