IPolygon polygon = new PolygonClass();
IPointCollection pointCollection = (IPointCollection)polygon;
添加大于三个点到 pointCollection 中,由于第一个点和最后一个点不一样,运行时出现错误“The number of points is less than required for feature”。
解决方案:
//执行如下代码,简化多边形
//Simplifies the polygon and maintains the index location of the from/to point of each ring
polygon.SimplifyPreserveFromTo();