I have a large dataset of habitat information that I need to calculate distances from animal locations to the closest polygon of each habitat type. The way to do this, that I understand, would be to create Euclidean distance rasters for each habitat type. But in order to do this I need to break apart the original layer into many different parts. I can do this by "Select by attribute" and create a new layer for each one, but I was wondering if there was a tool that automates that and breaks apart a layer into multiple smaller layers by unique values in a column. If not, oh well, I'll get down to selectin' and creatin'.

Thanks in advance.



2 Answers 2


Use a Feature Selection iterator in ModelBuilder. You can specify the field you want the selection to be grouped by (your field containing the unique values). It will iterate over your entire feature class, creating a selection layer from each unique value. You can then add more tools for the rest of your workflow.

enter image description here

  • This works like a charm. However, I'm really new to the Model Builder and I can't figure out how to get the Euclidean distance rasters to save themselves as unique path names and not get rewritten when the next one is created. If not, thanks a bunch for the help. Jan 31, 2013 at 23:18
  • As mentioned in the other answer, you will need to use inline variables to ensure a unique output for each raster. Using the iterator's inbuilt variable Value (containing the name of the current input), you can set the path for all your outputs uniquely, e.g. for the output allocation raster you can put C:\Documents\Allocation_raster_%Value%, and for the distance raster you would put C:\Documents\Distance_raster_%Value%. Feb 1, 2013 at 5:03

Iterators would definitely help you here. Just in case you would need to export the feature classes on disk first, I attach the image I've created recently.

an example of splitting the roads feature class into multiple ones based on roadtype field

In case you don't want to bother with the model building, consider using Split by Attributes tool already compiled and available for use as a GP tool that does exactly the same thing as the model above.

  • Awesome, thanks so much. I had to give the green checkmark to Arabella because they posted first, but this works perfectly too. The additional advice on how to export the feature class was great. I am having an issue exporting the created Raster from Arabella's suggestion for Euclidean distance. They keep being overwritten when a new one is created. Any ideas? If not, no worries, thanks so much for the help. Jan 31, 2013 at 23:20
  • Ah, no worries :) To avoid overwriting, I would also go for the Arabella's idea with inline variable substitution (resources.arcgis.com/en/help/main/10.1/index.html#/…), it seems to be the best. Feb 1, 2013 at 7:42
  • Perfect, thanks for the link. Worked like a charm. Feb 1, 2013 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.