从IPointCollection读取点效率比较

来源:互联网 发布:淘宝天天特价官网 编辑:程序博客网 时间:2024/05/18 11:50

 

我平时一般喜欢用第一种,思维定势吧。

 

但是,当读取一个线图层中,由20多w个点组成时,发现第一种很费时间。

 

于是,就寻找他路,终于,尝试方法2的时候,发现,找到了!

 

2比1的效率高太多!

 

再看帮助文档,如下:

IPointCollection.QueryPoint Method

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

 

看来,文档说的很清楚,只是平时用get_Point习惯了。