da.InsertCursor('D:/data/base.gdb/roads_maint', fields) # Create 25 new rows. Set default values on distance and CFCC code for x in range(0, 25): cursor.insertRow((x, 100, 'A10', datetime.datetime.now())) # Delete cursor object del cursor InsertCursor, пример 2 Исп...
Прежниеверсии: Этафункциябылазамененанаarcpy.da.InsertCursorв ArcGIS 10.1. Дляболеебыстройработы, используйтеarcpy.da.InsertCursor. НовыеобъектыRowмогутбытьполученыспо...
InsertCursor returns an enumeration object that hands out Row objects. ディスカッション レガシー: This function was superceded by arcpy.da.InsertCursor at ArcGIS 10.1. For faster performance, use arcpy.da.InsertCursor. New Row objects can be obtained using the newRow method on the enumeration...
代码实例 InsertCursor 示例 向表中插入 25 个新行。 1importarcpy23#Create insert cursor for table4rows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut")56#Create 25 new rows. Set the initial row ID and distance values7forxinxrange(1, 26):8row =rows.newRow()9row.setValue("rowid", x...
da.InsertCursor('C:/data/texas.gdb/counties', ['NAME', 'SHAPE@XY']) # Insert new rows that include the county name and a x,y coordinate # pair that represents the county center for row in row_values: cursor.insertRow(row) # Delete cursor object del cursor Use InsertCursor with the...
import arcpy # Create an insert cursor for a table rows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut") # Create 25 new rows. Set the initial row ID and distance values for x in range(1, 26): row = rows.newRow() row.setValue("rowid", x) row.setValue("distance", 100) ro...
InsertCursor (dataset, {spatial_reference}) Paramètre Explication Type de données dataset The feature class or table into which rows will be inserted. String spatial_reference Coordinates are specified in the spatial_reference provided and converted on the fly to the coordinate system of the datase...
InsertCursor example Inserts 25 new rows into a table. importarcpy# Create insert cursor for tablerows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut")# Create 25 new rows. Set the initial row ID and distance valuesforxinrange(1,26): row = rows.newRow() row.setValue("rowid", x)...
For faster performance, use arcpy.da.InsertCursor. New Row objects can be obtained using the newRow method on the enumeration object into which rows are to be inserted. Each call to insertRow on the cursor creates a row in the table whose initial values are set to the values in the ...
da.InsertCursor('C:/data/texas.gdb/counties', ['NAME', 'SHAPE@XY']) # Insert new rows that include the county name and a x,y coordinate # pair that represents the county center for row in row_values: cursor.insertRow(row) # Delete cursor object del cursor Use InsertCursor with the...