首页 > 编程语言 > 详细

arcgis python 开启编辑会话和编辑操作、在表中创建行、停止编辑操作以及提交编辑会话。

时间:2019-08-20 13:13:15      阅读:197      评论:0      收藏:0      [点我收藏+]
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)

 

arcgis python 开启编辑会话和编辑操作、在表中创建行、停止编辑操作以及提交编辑会话。

原文:https://www.cnblogs.com/gisoracle/p/11382169.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!