gis - Create a shapefile from a python list using ArcPy? -
I'm exploring a way to create a shape file with a python list (in the case given below, unique list).
Actually, I am using the cursor again through a shape file, and I would like to export the result as a shape file ... I tried copying ... but It also did not return an empty file. Nothing was returned. Arcpy.da.SearchCursor (unique_list for input in 'input_features, (' OBJECTID ',' SHAPE @ ') = [] arppy def find_overlaps (input_features, output_features) Import to
. 'Name')): foundMatch = wrong for row2 in uniqueList: If the punch Tit [1] .equals (row2 [1]): foundMatch = true break if foundMatch == Incorrect unique. List (line) Unique Return ## Not working ## Arcpy.management.CopyFeatures (Unique list, Output_ffecture)
I think you should use the feature class first Arcpy.CreateFeatureclass_managment () in this function you can use the Template feature to specify the field. You can use your inputp_features and if you want only selected fields, you can use arcpy.MakeFeatureLayer_management (), should work. Alternatively, you can create a feature class without fields and then use arcpy.AddField_management () to add the desired areas. There are some useful examples with the help of help for exact syntax.
Good luck.
Comments
Post a Comment