How do I export each polygon individually ?

5796
7
Jump to solution
06-01-2016 02:57 PM
FatmaŞenol
Occasional Contributor II

Hello,

I'm working on a polygon layer consist of more than 1000 polygons. I want to export each single polygon

as a new polygon layer. Is there a simple way to perform this task ? Thank you.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor

If it was a shapefile, you could use http://www.arcgis.com/home/item.html?id=15ca63aebb4647a4b07bc94f3d051da5  using the FID (or objectid) field.  It isn't setup to work with featureclasses for a variety of reasons, hence, the extra step to export to a shapefile first

View solution in original post

7 Replies
DanPatterson_Retired
MVP Esteemed Contributor

If it was a shapefile, you could use http://www.arcgis.com/home/item.html?id=15ca63aebb4647a4b07bc94f3d051da5  using the FID (or objectid) field.  It isn't setup to work with featureclasses for a variety of reasons, hence, the extra step to export to a shapefile first

MarcelaRondon
Occasional Contributor

The link seems to be broken, can you post the answer again, please?

0 Kudos
DarrenWiens2
MVP Honored Contributor

I think Dan Patterson​ made a tool to do this (SplitFeatureClassByAttribute, or similar). Oh, he beat me to it.

Or, you could make a ModelBuilder model using Iterate Feature Selection, followed by Copy Features.

Or, if you prefer a Python answer, let me know.

FatmaŞenol
Occasional Contributor II

Hi Darren,

Could you please share the python answer with me ?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

The toolbox I reference has python scripts that you can use, if you want to edit it for your case.

0 Kudos
DarrenWiens2
MVP Honored Contributor
>>> fc = 'all_aoi' # path to feature class or name of layer in map
... arcpy.env.workspace = r'in_memory' # default folder
... OID_field = arcpy.Describe(fc).OIDFieldName # get OID/FID field name
... with arcpy.da.SearchCursor(fc,OID_field) as cursor: # create cursor
...    for row in cursor: # loop through features
...        where = '{0} = {1}'.format(arcpy.AddFieldDelimiters(fc,OID_field),row[0]) # set up where clause
...        arcpy.SelectLayerByAttribute_management(fc,"NEW_SELECTION",where) # select the current feature
...        arcpy.CopyFeatures_management(fc,'Output_' + str(row[0])) # output feature to new feature class
FatmaŞenol
Occasional Contributor II

Hi

Thank you for your great help.

0 Kudos