关于arcpy中Table,FeatureClass处理中常用工具整理

1、遍历工具:

ListFeatureClasses ({wild_card}, {feature_type}, {feature_dataset})

ListTables ({wild_card}, {table_type})

相关链接:http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000v0000001t000000/

 

2、操作Row,包括insert、delete、update。

    首先,用游标Cursor,逐行扫描Row,找到需要修改的行(Cursor详细内容:http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000v00000068000000/),在遍历FeatureClass,所用到的遍历方式有 InsertCursor,SearchCursor,UpdateCursor三种,具体信息(http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000v00000068000000/)。

    通过三种不同的Cursor,执行对应的操作,常用才Cursor操作见下表:

方法说明
deleteRow (row)

Deletes a row in the database. The row corresponding to the current position of the cursor will be deleted.

insertRow (row)

Inserts a new row into the database.

newRow ()

Creates an empty row object.

next ()

Returns the next object at the current index.

reset ()

Sets the current enumeration index (used by the next method) back to the first element.

updateRow (row)

The updateRow method can be used to update the row at the current position of an update cursor.

另Row的方法:来源(http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000v000000nv000000/

 

方法说明
getValue (field_name)

Gets the field value.

isNull (field_name)

Is the field value null.

setNull (field_name)

Sets the field value to null.

setValue (field_name, object)

Sets the field value.

 

 

 

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值