You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Geoprocessing Scripting (Python, JavaScript, VB) forum

Extract all Polygons from shapefile into in...   Ray Davis Oct 28, 2004
Re: Extract all Polygons from shapefile int...   Dave Bollinger Oct 28, 2004
Re: Extract all Polygons from shapefile int...   Nathan Warmerdam Oct 28, 2004
Re: Extract all Polygons from shapefile int...   Amy Steiger Oct 28, 2009
Re: Extract all Polygons from shapefile int...   R.D. Harles Oct 29, 2009
Re: Extract all Polygons from shapefile int...   Ray Davis Oct 29, 2004
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Extract all Polygons from shapefile into individual shapefiles 
Author Ray Davis 
Date Oct 28, 2004 
Message Hi there,
I have no experience with scripting (either VB or Python,) and I think that's what I'll need to accomplish this task.

I have a shapefile that contains about 350 US counties. I'd like to extract each one of these counties into their own shapefiles, so I'd end up with 350 shapefiles. We are going to use each county shapefile as a mask to do calculation. How would I go about doing this?

I'd like to name the files using a field value for each county (FIPS_code.)

Help!!!

Thanks,

Ray 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Extract all Polygons from shapefile into individual shapefiles 
Author Dave Bollinger 
Date Oct 28, 2004 
Message You'll need scripting for the loop. I'd probably think about structuring it like this to make it more managable:

1. Create a layer for your counties feature class, include all features, see Make Feature Layer tool.

2. Create a function that takes a FIPS code as a parameter. It then defines a new temporary layer based on your counties, see Select Layer by Attribute tool. It then copies the selected features of that layer to a new shapefile, see Copy Features tool.

3. Once you have that supporting function worked out, then focus on the "driver" loop. You'll open up a select cursor on the counties layer, loop through each record, retrieve the FIPS value for that record, and call your "SaveFIPStoShapefile" function.

Hope that at least gives you some ideas, 
  Dave Bollinger
Programmer/Analyst
San Joaquin County, CA 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Extract all Polygons from shapefile into individual shapefiles 
Author Nathan Warmerdam 
Date Oct 28, 2004 
Message Heres a really simple way to do it without using scripting.

Use the SPLIT tool (Analysis Tools -> Split). Set both the Input FC and the Split FC to your counties shapefile. Set the field to a unique field. The value in this field will also be the name of the output shapefiles... has to be text field. Set the output workspace to wherever your want to write out all of your shapefiles.

You should get a folder full of data... one shapefile for each county. (I tried it on the counties of Texas using shapefile input and it worked fine).

hope this helps. 
  nbw 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Extract all Polygons from shapefile into individual shapefiles 
Author Amy Steiger 
Date Oct 28, 2009 
Message Does this function still exist? This does exactly what I want it to.

I am running ArcEditor on 9.3.1 and don't have a Split tool in ArcToolbox. 
  Amy Steiger

GIS Analyst
Wollongong, Australia 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Extract all Polygons from shapefile into individual shapefiles 
Author R.D. Harles 
Date Oct 29, 2009 
Message Hi Amy,
The SPLIT tool requires an "ArcInfo" license.
With the ArcEditor or ArcView license, the split_analysis tool won't be available to you.
 
  -----------------
R.D. Harles
ADCi
www.adci.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Extract all Polygons from shapefile into individual shapefiles 
Author Ray Davis 
Date Oct 29, 2004 
Message I'm all for simple! The split thing did exactly what I needed. Thanks Nathan and Dave for your help!

Ray Davis
Hydrologist
NOAA's National Weather Service
Ohio River Forecast Center