Simple Way To Batch Export Features Based On Attributes In ArcMap 9.3

This is a tip for ArcGIS 9.3 users.

Today, I was working with a very large shapefile (1GB+), and I needed to parse it into several smaller shapefiles based on attributes from a specific field.

There are various methods to doing this. The most time consuming would be to use ‘Select by Attribute’ for each individual attribute and simply export these features manually. This is simple, but takes a long time.

I didn’t have time to do this, so rather than use ModelBuilder I searched and fortunately found a script for ArcToolbox that automated this process: Split Layer By Attributes (authored by Dan Patterson).

Split Layer By Attributes Screenshot

Script summary:

Splits a layer according to attributes within the selected field producing a separate shapefile for common attributes.

If the FID or some other unique ID field is used, you can effectively produce separate shapefiles for each feature. If you are using a decimal field with a scale of 0 or an integer field or a string field, you can have one or more features in the output shapefile. Date fields need to be converted to a string field and integer fields should contain positive numbers

The selected field is queried for unique conditions. If a prior selection exists, then only those records are queried. The unique values found in the field (or selection within) are used to partition the input layer into the output layers.

4 Steps:

1. Select the input layer.
2. Select the input field.
3. Tpe an optional output filename (the default is the layer name with the select attribute appended to it.
4. Select the output folder.

Viola. The script spits out separate shapefiles for each different attribute within the selected field.

Since I was working with an enormous shapefile to begin with, the process took a few hours.

Say thanks to Dan Patterson for the free script.

[image via PJ]