I am looking for a way to split a feature class into multiple feature classes based on the number of records, probably using python. E.g first 100, next 100, etc. I have so far only seen options to split by attributes.
Answer
As @klewis mentioned you could use the Split By Attribute feature:
Esri provides the following sample code that you could use as mentioned:
# Name: SplitByAttributes.py
# Description: Use the SplitByAttributes tool to split a feature class by
# unique values.
# Import required modules
import arcpy
#Set local variables
in_feature_class = 'c:/data/base.gdb/ecology'
target_workspace = 'c:/data/output.gdb'
fields = ['REGION', 'ECO_CODE']
arcpy.SplitByAttributes_analysis(in_feature_class, target_workspace, fields)
No comments:
Post a Comment