ArcEngine将地图上的点元素转为Feature并获得坐标
答案:2 悬赏:80 手机版
解决时间 2021-02-03 08:04
- 提问者网友:且恨且铭记
- 2021-02-02 07:31
比如我通过IElement在地图上点了几个点,现在想知道这些点元素在地图上的坐标并存储为.shp图层,怎么做?
最佳答案
- 五星知识达人网友:一把行者刀
- 2021-02-02 08:26
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();
}
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();
}
全部回答
- 1楼网友:人间朝暮
- 2021-02-02 08:46
任务占坑
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯