IArea接口(计算多边形面积)
//利用IArea接口计算多边形面积
private Double MeasurePolygon(IPolygon pPolygon) { IArea pArea = (IArea)pPolygon; Double dArea = Math.Abs(pArea.Area); return dArea; }
//面积接口IArea public double GetMeanArea(List<IFeature> Polygon) { //求多边形的平均面积 double dArea = 0; foreach (IFeature polygon in Polygon) { IArea pArea = polygon.Shape as IArea; dArea = dArea + pArea.Area; } MeanArea = dArea / Polygon.Count; return MeanArea; }