I have question about ArcGIS and python script. There are following sample code, So I would like to change Another Field , not OIDFieldName. Please let me know how to change Another Field.
import arcpy
import itertools
arcpy.env.workspace = r"C:\path\to\workspace"
base_shapefile = "some_shapefile.shp"
oid_field = arcpy.Describe(base_shapefile).OIDFieldName
feature_count = int(arcpy.GetCount_management(base_shapefile).getOutput(0))
for (i, j) in itertools.combinations(range(feature_count), 2):
arcpy.Select_analysis(base_shapefile , "combination_%i_%i.shp" % (i, j), '"%s" in (%i, %i)' % (oid_field, i, j))
These sample code is combination for 5C2. I want to create all combiantions 5C3 , 5C4 , 5C5.
No comments:
Post a Comment