arcpy.conversion.JSONToFeatures(tmp, out_fc)except:# this isn't much better..gp = arcpy.geoprocessing._base.Geoprocessor()# create arcpy.FeatureSet from raw JSON stringarcpy_fs = gp.fromEsriJson(fs.dumps(indent=None)) arcpy_fs.save(out_fc)except:# manually add records with insert cursor...
# Create insert cursor for 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) rows.insertRow(row) ...
cid=arrays[cntr_id_field][tri[0]]ifcid == arrays[cntr_id_field][tri[1]]andcid == arrays[cntr_id_field][tri[2]]: cursor.insertRow([cid,arcpy.Polygon(arcpy.Array([arcpy.Point(*arrays['SHAPE@XY'][i])foriintri]))]) arcpy.SetProgressor('default','Merging Delaunay Triangle...')...
SetProgressorPosition() cid=arrays[cntr_id_field][tri[0]] if cid == arrays[cntr_id_field][tri[1]] and cid == arrays[cntr_id_field][tri[2]]: cursor.insertRow([cid,arcpy.Polygon(arcpy.Array([arcpy.Point(*arrays['SHAPE@XY'][i]) for i in tri]))]) arcpy.SetProgressor('...
You can write the Esri polygon to a new feature class using an insert cursor. Example: new_fc = r"C:\path\to\your\geodatabase.gdb\NewFeatureClass" with arcpy.da.InsertCursor(new_fc, ["SHAPE@"]) as cursor: cursor.insertRow([esri_polygon]) Remember to adjust the code according to ...
ArcPy 包含涉及其他 ArcGIS 领域的模块。有一系列模块支持 ArcPy,包括数据访问模块 (arcpy.da)、制图模块 (arcpy.mapping)、ArcGIS Spatial Analyst扩展模块 (arcpy.sa) 和ArcGIS Network Analyst 扩展模块 (arcpy.na)。 例如,arcpy.sa 模块中的工具将使用 Spatial Analyst 工具箱中的工具,但被配置为支持“地图代数...
insertRow([create_random_coordinates(), "Wire Down", desc, "High"]) Added 5 feature(s) Any time an insert or update cursor will save changes, it will print a short message showing how many features were affected. You can always get at the raw edit information from the FeatureLayer by ...
An Insert Cursor should work nicely for you.Also, the "list out of range" error may be due to no Dataframes in the MXD that start with "La" as you specify when you are creating the "df" variable. If ArcPy can't find any dataframes in the MXD that start with "La" then it ...
Using an Insert cursor Inserting a polyline geometry Inserting a polygon geometry Summary ArcPy Geometry Objects and Cursors ArcPy geometry object classes ArcPy Point objects ArcPy Array objects ArcPy Polyline objects ArcPy Polygon objects Polygon object buffers Other Polygon object methods The AsShape meth...
fastest approach is to use cursor """iflen(fc_list) ==1: arcpy.Copy_management(fc_list[0], output_fc) output_msg("Created {0}".format(output_fc))else:forfcinfc_list:iffc_list.index(fc) ==0:# append to first dataset. much fasteroutput_msg("Prepping yer first dataset {0}".form...