ArcGIS Engine C#向点要素集中插入数据
//连接Oracle的SDE数据源
IWorkspace pWkspace = DBConnOracle.DBConnWorkSpace();
IFeatureWorkspace FeatureWorkspace = pWkspace as ESRI.ArcGIS.Geodatabase.IFeatureWorkspace;
FeatureClass = FeatureWorkspace.OpenFeatureClass("QGQXZD");//点要素名称
IFeature newLineFeature = FeatureClass.CreateFeature();
//字段索引值
int IndexBySTATION_ID = newLineFeature.Fields.FindField("STATION_ID");
int IndexBySTATION_NAME = newLineFeature.Fields.FindField("STATION_NAME");
int IndexByPROVINCE = newLineFeature.Fields.FindField("PROVINCE");
int IndexByLAT = newLineFeature.Fields.FindField("LAT");
int IndexByLON = newLineFeature.Fields.FindField("LON");
int IndexBySPI = newLineFeature.Fields.FindField("SPI");
int IndexByPDSI = newLineFeature.Fields.FindField("PDSI");
//设置字段值
newLineFeature.set_Value(IndexBySTATION_ID, 53602);
newLineFeature.set_Value(IndexBySTATION_NAME, "阿拉善");
newLineFeature.set_Value(IndexByPROVINCE, "内蒙古");
newLineFeature.set_Value(IndexByLAT, 105.4);
newLineFeature.set_Value(IndexByLON, 38.5);
newLineFeature.set_Value(IndexBySPI, 120.2);
newLineFeature.set_Value(IndexByPDSI, 12.22);
//执行添加
newLineFeature.Store();