arcpy.CopyFeatures_management(lyr, tmp_fc) f_list = arcpy.ListFields(tmp_fc) for f in f_list: if f.type not in ('OID', 'Geometry'): arcpy.DeleteField_management(tmp_fc, f) #delete all fields except of geometry and FID arcpy.AddField_management(tmp_fc, field1, 'TEXT') arcpy.AddField_management(tmp_fc, field2, 'LONG') # adding fields you need ... arcpy.CalculateField_management(tmp_fc, filed1, value1) arcpy.CalculateField_management(tmp_fc, filed2, value2) ... arcpy.Append_management(tmp_fc, out_fc, *params)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.