關於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.

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章