Create New Feature Classes based on an Attribute

2013
7
01-13-2011 08:28 AM
MatthewBoyle
Occasional Contributor
Does anyone know of a way to export new feature classes based on an attribute?  For example, I have a contour layer and I want to export each unique value in the elevation field to it's own feature class.  Any ideas...?  Thanks!
0 Kudos
7 Replies
FrankVignati
Occasional Contributor II
Does anyone know of a way to export new feature classes based on an attribute?  For example, I have a contour layer and I want to export each unique value in the elevation field to it's own feature class.  Any ideas...?  Thanks!


if you want to do this in a model you can use the feature class to feature class tool from the conversion tools/to geodatabase and put the select query in the expression, or just do it one at a time using the same tool
0 Kudos
MatthewBoyle
Occasional Contributor
Dan,

I downloaded and tested out your tool.  I'm trying to use it with a contour layer.  So for every unique elevation, I'd like to create a shapefile for that elevation.  When I run your tool, it seems to work for one elevation but all the other elevations are tagged with 'did not work'...any ideas on what I'm doing wrong...?
0 Kudos
DanPatterson_Retired
MVP Emeritus
I failed to mention that you should add a new text field and get a text representation of the elevation.  Floating point numbers aren't supported directly.  If that doesn't work, zip the shapefile and email it to me at Dan_Patterson AT carleton DOT ca and I will have a look
0 Kudos
BruceHarold
Esri Regular Contributor
Hi

You can do this with a model using iterators.  I attach an example working with contour features.

Regards
0 Kudos
MatthewBoyle
Occasional Contributor
Bruce,

What exactly do I need to change to your model in order to get my data to work?  I haven't used iterators before.  Some background info on my data:

Contour data is in shapefile format.  The 'Elevation' field is a double field type.  I'd like to have the resulting shapefiles put in a separate folder if possible.

Questions:
1) Does my data need to be in geodatabase format?
2) Do I need to change the workspace in the model?
0 Kudos
Annisa_IndahSari
New Contributor
1) Does my data need to be in geodatabase format?
If you use in Model Builder, then it is better to convert your data into geodatabase file in order to better fit the application.
2) Do I need to change the workspace in the model?
If you create Personal Geodatabase, then u can use it as a workspace. This is also a good way to make a model.
0 Kudos