Failure of Split_analysis to export all polygons

404
4
03-17-2011 10:38 AM
ToddGiberson
New Contributor
For the first time today I attempted to split a large dataset into smaller pieces using the Split_analysis tool.  I am attempting to split an entire statewide shapefile into county by county pieces.  Here is my code as entered in the Python window:

arcpy.Split_analysis("blk","blk","CNTY","c:\census2010")

The statewide shapefile is "blk" and "CNTY" is the county FIPS code attached to each census block.

Running the command does indeed produce output for each selected county, but only a small number of blocks from each county make it into the output shapefile (easily less than 10% of the features).  Is there some limit to this operation or is there some other explanation?
0 Kudos
4 Replies
BBicking1
Esri Contributor
For the first time today I attempted to split a large dataset into smaller pieces using the Split_analysis tool.  I am attempting to split an entire statewide shapefile into county by county pieces.  Here is my code as entered in the Python window:

arcpy.Split_analysis("blk","blk","CNTY","c:\census2010")

The statewide shapefile is "blk" and "CNTY" is the county FIPS code attached to each census block.

Running the command does indeed produce output for each selected county, but only a small number of blocks from each county make it into the output shapefile (easily less than 10% of the features).  Is there some limit to this operation or is there some other explanation?



Hi tcg1,

by name your Input Features and your Split Features are the same - are they?

According to what you write, your Split Features ought to be a feature class with the county outlines/borders. Is that what the Split Features "blk" represents?

Barbara Bicking
0 Kudos
ToddGiberson
New Contributor
Perhaps I'm not understanding the syntax.  It appeared from the instructions that the splitting of features was not based on geographic boundaries as the old Arc/Info SPLIT command had been, but instead was based on a field in a table.  In my case I have a statewide shapefile of census blocks, each with a county code, and I was trying to split the large shapefile into county by county pieces.

So "blk" was my "in_features" layer, but I also used it as my "split_features" layer as it contained the tabular "split_field" of the county code.  And it did work to some degree, as I got separate output shapefiles for each county, but only a portion of the blocks rather than the whole county.

Is there another way to accomplish my task without having to select individual counties one by one and export the selected data?  If I was working with Delaware's three counties I would have done that, but I'm in Texas where we have 254 counties.
0 Kudos
ToddGiberson
New Contributor
I've just now gone back and retried the split -- this time with a normal split shapefile of the county boundaries.  This is working.  My correct syntax is:

arcpy.Split_analysis("blk","cnty","CNTY","c:\census2010")

I'm not sure what was happening when I tried it the other way but since it worked partially I was thinking it might work that way.

Thanks, Barbara.
0 Kudos
BBicking1
Esri Contributor
I've just now gone back and retried the split -- this time with a normal split shapefile of the county boundaries.  This is working.  My correct syntax is:

arcpy.Split_analysis("blk","cnty","CNTY","c:\census2010")

I'm not sure what was happening when I tried it the other way but since it worked partially I was thinking it might work that way.

Thanks, Barbara.




Hi Todd,

Great - you succeeded!

Barbara Bicking
0 Kudos