页面载入中....
Google


高效的Insert方法 
zdq 发表于 2007-7-25 21:15:00

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

阅读全文 | 回复(3) | 引用通告 | 编辑

Re:高效的Insert方法
天涯(游客)发表评论于2008-5-31 9:47:00

天涯(游客)IFeatureClass.CreateFeatureBuffer()在注册版本后就不能使用了,只能用IFeatureClass.CreateFeature()
个人主页 | 引用 | 返回 | 删除 | 回复

Re:高效的Insert方法
zdq发表评论于2007-7-31 9:49:00

zdq添加Feature有两种办法,呵呵。IFeatureClass. CreateFeature是一种。
个人主页 | 引用 | 返回 | 删除 | 回复

Re:高效的Insert方法
luo(游客)发表评论于2007-7-27 10:36:00

luo(游客)不明白,Ifeatureclass的insert方法本来就是要featurebuffer的啊。
个人主页 | 引用 | 返回 | 删除 | 回复
发表评论:
页面载入中....

 

页面载入中....

  公告
页面载入中....

  我的分类(专题)
页面载入中....
  日志搜索
    最近日志
页面载入中....

  最新评论
页面载入中....

  留言板
页面载入中....

  链接

  Blog信息
页面载入中....





Powered by Oblog.