SDE如何Export Simple FC到PGDB
相比Annotation FeatureClass的输出, simple featureclass(point,line,polygon)相对要简单(不需要创建新的AnnotAtIon FC). 利用 IExportOperation.ExportOperation就能导出.
Private Sub ExportSimple(pFC As IFeatureClass, pFilter As IQueryFilter, OutputLocation)
Dim pSelectionSet As ISelectionSet
Dim pExportOp As IExportOperation
Dim pDataset As IDataset
Dim pInFeatureClassName As IFeatureClassName
Dim pInDsName As IDatasetName
Dim pFeatureClassName As IFeatureClassName
Dim pOutDatasetName As IDatasetName
Dim pWorkspaceName As IWorkspaceName
Dim pProgID As String
pProgID = "esriDataSourcesFile.AccessWorkspaceFactory"
Set pSelectionSet = pFC.Select(pFilter, esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, Nothing)
Set pWorkspaceName = New WorkspaceName
pWorkspaceName.PathName = OutputLocation
pWorkspaceName.WorkspaceFactoryProgID = pProgID
Set pDataset = pFC
Set pInFeatureClassName = pDataset.FullName
Set pInDsName = pInFeatureClassName
Set pFeatureClassName = New FeatureClassName
Set pOutDatasetName = pFeatureClassName
' pOutDatasetName.Name = pFeatCls.AliasName & "_exp"
Dim position As Integer
position = InStr(pFC.AliasName, ".")
If position > 0 Then
pOutDatasetName.Name = Right(pFC.AliasName, Len(pFC.AliasName) - position)
Else
pOutDatasetName.Name = pFC.AliasName
End If
' pOutDatasetName.Name = pFeatCls.AliasName
Set pOutDatasetName.WorkspaceName = pWorkspaceName
Set pExportOp = New ExportOperation
pExportOp.ExportFeatureClass pInDsName, Nothing, pSelectionSet, Nothing, pOutDatasetName, 0
Set pSelectionSet = Nothing
Set pExportOp = Nothing
Set pDataset = Nothing
Set pInFeatureClassName = Nothing
Set pInDsName = Nothing
Set pFeatureClassName = Nothing
Set pOutDatasetName = Nothing
Set pWorkspaceName = Nothing
End Sub
Dim pSelectionSet As ISelectionSet
Dim pExportOp As IExportOperation
Dim pDataset As IDataset
Dim pInFeatureClassName As IFeatureClassName
Dim pInDsName As IDatasetName
Dim pFeatureClassName As IFeatureClassName
Dim pOutDatasetName As IDatasetName
Dim pWorkspaceName As IWorkspaceName
Dim pProgID As String
pProgID = "esriDataSourcesFile.AccessWorkspaceFactory"
Set pSelectionSet = pFC.Select(pFilter, esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, Nothing)
Set pWorkspaceName = New WorkspaceName
pWorkspaceName.PathName = OutputLocation
pWorkspaceName.WorkspaceFactoryProgID = pProgID
Set pDataset = pFC
Set pInFeatureClassName = pDataset.FullName
Set pInDsName = pInFeatureClassName
Set pFeatureClassName = New FeatureClassName
Set pOutDatasetName = pFeatureClassName
' pOutDatasetName.Name = pFeatCls.AliasName & "_exp"
Dim position As Integer
position = InStr(pFC.AliasName, ".")
If position > 0 Then
pOutDatasetName.Name = Right(pFC.AliasName, Len(pFC.AliasName) - position)
Else
pOutDatasetName.Name = pFC.AliasName
End If
' pOutDatasetName.Name = pFeatCls.AliasName
Set pOutDatasetName.WorkspaceName = pWorkspaceName
Set pExportOp = New ExportOperation
pExportOp.ExportFeatureClass pInDsName, Nothing, pSelectionSet, Nothing, pOutDatasetName, 0
Set pSelectionSet = Nothing
Set pExportOp = Nothing
Set pDataset = Nothing
Set pInFeatureClassName = Nothing
Set pInDsName = Nothing
Set pFeatureClassName = Nothing
Set pOutDatasetName = Nothing
Set pWorkspaceName = Nothing
End Sub
-----------------------------------------------------------
佛对我说:你心里有尘。我用力的拭擦。