问题描述
- c# Arc engine 二次开发,面积计算问题
-
计算多边形的面积,直接调用Iarea接口的area属性得到的面积和在arcgis里计算的面积不一样,请问怎么回事,是不是代码中需要设置坐标系统,请高人指点,谢谢!
部分代码
IFeatureClass pafeature = pFeatCl as IFeatureClass;
for (int i = 0; i < pafeature.FeatureCount(null); i++)
{
IFeature pFeature = pFeatCl.GetFeature(i);
IArea parea = pFeature.Shape as IArea;
pFeature.set_Value(pFeature.Fields.FindField("area"), parea.Area);
pFeature.Store();
}
时间: 2024-12-01 06:42:47