arcgis python 開啟編輯會話和編輯操作、在表中創(chuàng)建行、停止編輯操作以及提交編輯會話。2019-08-20

import arcpy

import os

fc = 'Database Connections/Portland.sde/portland.jgp.schools'

workspace = os.path.dirname(fc)

# Start an edit session. Must provide the worksapce.

edit = arcpy.da.Editor(workspace)

# Start an edit operation

edit.startOperation()

# Edit session is started without an undo/redo stack for versioned data

#? (for second argument, use False for unversioned data)

edit.startEditing(False, True)

# Insert a row into the table.

with arcpy.da.InsertCursor(fc, ('SHAPE@', 'Name')) as icur:

? ? icur.insertRow([(7642471.100, 686465.725), 'New School'])

# Stop the edit operation.

edit.stopOperation()

# Stop the edit session and save the changes

edit.stopEditing(True)

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • pyspark.sql模塊 模塊上下文 Spark SQL和DataFrames的重要類: pyspark.sql...
    mpro閱讀 9,929評論 0 13
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa閱讀 9,067評論 0 6
  • 蒼海桑田一陣風, 三十年河西變東。 昔日繁華隨風去, 斷墻殘垣露真容。
    朝東_36b1閱讀 85評論 0 1

友情鏈接更多精彩內容