ArcEngine将地图上的点元素转为Feature并获得坐标

2025-04-08 03:12:09
推荐回答(1个)
回答1:

IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView.GraphicsContainer;
pGraphicsContainer.Reset();
IElement ele = pGraphicsContainer.Next();
while(ele!=null)
{
if (ele.Geometry is IPoint)
{
IFeature feature = pointFeatureClass.CreateFeature();
feature.Shape = ele.Geometry;
//feature.set_Value(0, value);
feature.Store();
}
ele = pGraphicsContainer.Next();
}