The number of points is less than required for feature

来源:互联网 发布:网络功放机连接 编辑:程序博客网 时间:2024/05/01 04:37
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 ringpolygon.SimplifyPreserveFromTo();



原创粉丝点击