调用gp工具把shp、mdb、gdb中的table导入到sde(oracle)中
添加这两个引用
using ESRI.ArcGIS.ConversionTools;//
using ESRI.ArcGIS.Geoprocessor;
调用gp 实现shp入库
//调用gp工具
public void shpFeatureClassToGeodatabase(string inputPath, string sdePath)
{
//TableToGeodatabase
Geoprocessor geoprocessor = new Geoprocessor();
FeatureClassToGeodatabase featureClassToGeodatabase = new FeatureClassToGeodatabase();
featureClassToGeodatabase.Output_Geodatabase = sdePath;
featureClassToGeodatabase.Input_Features = inputPath;
featureClassToGeodatabase.Derived_Geodatabase = "";
geoprocessor.OverwriteOutput = true;
try
{
geoprocessor.Execute(featureClassToGeodatabase, null);
}
catch (Exception ex)
{
string mess = null;
for (int k = 0; k < geoprocessor.MessageCount; k++)
{
mess += geoprocessor.GetMessage(k) + "\n";
}
MessageBox.Show(mess);
}
}
3。调用gp 实现table入库sde
//table 入库
//调用gp工具
public void gpTableToGeodatabase(string inputTablePath, string sdePath)
{
Geoprocessor geoprocessor = new Geoprocessor();
TableToGeodatabase tableTosde = new TableToGeodatabase();
tableTosde.Input_Table = inputTablePath;
tableTosde.Output_Geodatabase = sdePath;
tableTosde.Derived_Geodatabase="";
geoprocessor.OverwriteOutput = true;
try
{
geoprocessor.Execute(tableTosde, null);
}
catch (Exception ex)
{
string mess = null;
for (int k = 0; k < geoprocessor.MessageCount; k++)
{
mess += geoprocessor.GetMessage(k) + "\n";
}
MessageBox.Show(mess);
}
}
在arcgis中,连接上的sde后,右键-属性可以找到这个sde的文件位置
问题交流:152702136(QQ群)
转载自:https://blog.csdn.net/qq_33222460/article/details/79651800