posts - 40,  comments - 18,  trackbacks - 0
Insert Feature是我们在开发过程中最容易遇到的问题,如果Insert的feature个数有限,那么你也许不关注Insert的速度问题。但是数据量比较大》500个的时候,你就会发现如果使用 IFeatureClass. CreateFeature的速度基本是无法忍受的。

其实ArcObjects中提供了一个接口,可以满足快速批量插入的要求。他就是:IFeatureBuffer
使用方法如下:

        Set pFeatureBuffer = pFC.CreateFeatureBuffer
        Set pFeatureCursor = pFC.Insert(True)
        Set pFeature = pFeatureBuffer
        Set pPolyline = New Polyline
       
        'Create 100 features using FeatureBuffer and insert into a feature cursor
        For i = 0 To 99
           
            'Set the feature's shape TODO
            Set pFeature.Shape = pPolyline
           
            'Insert the feature into the feature cursor
            q = pFeatureCursor.InsertFeature(pFeatureBuffer)
        Next i
       
        'Flush the feature cursor to the database
        pFeatureCursor.Flush
posted on 2008-05-08 09:16 王者之魂 阅读(180) 评论(0)  编辑 收藏

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-07-18 12:55 编辑过
 
另存  打印
 

众 万
志 众
成 一
城 心

诚 心
祝 愿
中 震
国 区
人 百
民 姓
幸 安
福 康

QQ:13945133
MSN:yangguanjunmeteor@hotmail.com


<2008年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

与我联系

常用链接

留言簿(1)

我参与的团队

我的标签

随笔档案(40)

友情链接

搜索

  •  

最新评论

阅读排行榜

评论排行榜

60天内阅读排行