Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'd like to split a single shapefile to multiple shapefile by attribute. I found ET Geowizard to do this but it's not free . I arcscripts.esri.com i found a tool named "SplitLayerByAttributes" but it does not work in ArcMap . Do you know any tools or solution to split by attribute ?

share|improve this question

3 Answers

up vote 3 down vote accepted

Here are some more free third-party tools that split by attribute:

share|improve this answer
+1 For recommending GME – Aaron Jan 31 at 16:38

did you see Split Layer By Attributes tool updated for ArcMap 10 here. if it doesnt work you can use Split (Analysis) for your needs.

Splitting the Input Features creates a subset of multiple output feature classes. The Split Field's unique values form the names of the output feature classes. These are saved in the target workspace.

split

Example Code:

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.Split_analysis("Habitat_Analysis.gdb/vegtype", "climate.shp", "Zone",
                     "C:/output/Output.gdb", "1 Meters")

i hope it helps you...

share|improve this answer
The built-in Split tool works great for your purposes if you create an extent rectangle the same size as your polygons you wish to split. – ccn Jan 31 at 16:25

I do not have access to ArcMap 10, only 9.3, but I expect that it won't be very different from this.

You can create a simple script in Python, that checks your attribute field for different values, and then, for each of them runs a SELECT operation to your original Shapefile.

If you are not familiar with python scripting, all you need to do is open you IDLE (the python GUI) create a new file, and copy the code below. After adapting the code for your my_shapefile, outputdir and my_attribute it should work.

# Script created to separate one shapefile in multiple ones by one specific
# attribute

# Example for a Inputfile called "my_shapefile" and a field called "my_attribute"
import arcgisscripting

# Starts Geoprocessing
gp = arcgisscripting.create(9.3)
gp.OverWriteOutput = 1

#Set Input Output variables
inputFile = u"C:\\GISTemp\\My_Shapefile.shp" #<-- CHANGE
outDir = u"C:\\GISTemp\\" #<-- CHANGE

# Reads My_shapefile for different values in the attribute
rows = gp.searchcursor(inputFile)
row = rows.next()
attribute_types = set([])

while row:
    attribute_types.add(row.my_attribute) #<-- CHANGE my_attribute to the name of your attribute
    row = rows.next()

# Output a Shapefile for each different attribute
for each_attribute in atribute_types:
    outSHP = outDir + each_attribute + u".shp"
    print outSHP
    gp.Select_analysis (inputFile, outSHP, "\"my_attribute\" = '" + each_attribute + "'") #<-- CHANGE my_attribute to the name of your attribute

del rows, row, attribute_types, gp

#END
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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