阅读:1849回复:2
怎么更新一个特征的属性字段值
<P>那位大侠知道怎么更新一个特征的属性字段值啊~~~~ </P>
<P>Dim pCursor As IFeatureCursor<BR> Set pCursor = pFeatureLayer.Search(pFilter, False)<BR> Dim pfeature As ifeature<BR> Set pfeature = pCursor.NextFeature<BR> 我查询之后得到了一些特征,现在要修改这些特征的属性字段,</P> <P>帮助上说pfeature.Value(n) = xxx 应该是可以直接赋值的,可是还需要更新才能行,不知道怎么搞咯·~~~~~</P> |
|
1楼#
发布于:2006-11-02 10:47
<P>谢了啊,我已经搞定了, 有个store函数是存储改变值得</P>
|
|
2楼#
发布于:2006-11-01 10:28
<P>看看我程序中的一段,是更新面积字段,对你会有帮助 </P>
<P>//更新字段值<BR> IFeatureCursor pFeatCursor=pFeatClass.Update(null,false);<BR> IFeature pFeature=pFeatCursor.NextFeature();<BR> while (pFeature!=null)<BR> {<BR> IGeometry pGeom= pFeature.ShapeCopy;<BR> IPolygon pPoly=(IPolygon)pGeom;<BR> IArea pArea=(IArea)pPoly;<BR> double dArea=pArea.Area;<BR> nIndex=pFields.FindField("Shape_Area");<BR> pFeature.set_Value(nIndex,(object)dArea);</P> <P> pFeatCursor.UpdateFeature(pFeature);</P> <P> pFeature=pFeatCursor.NextFeature();<BR> }<BR></P> |
|