ArcView automated script or macro to select and export features
#1
Posted 13 June 2008 - 12:17 PM
Example:
Load county shapefile for NJ. Load census tracts shapefile for NJ. Export 21 shapefiles, 1 per county, containing all census tracts inside each county.
I can do this manually, but of course there must be a way to automate it, without resorting to actual VB.NET or Python scripting. Either through a macro, an existing plug-in, or a script on the user-submitted scripts page.
I've been poking around the arcscripts.esri.com page, but apparently the terms I am entering are not what people use to describe this process.
#2
Posted 13 June 2008 - 12:54 PM
#3
Posted 13 June 2008 - 12:58 PM
Split Layer By Attributes
http://arcscripts.es....asp?dbid=14127
#4
Posted 13 June 2008 - 01:04 PM
#5
Posted 13 June 2008 - 01:23 PM
it seems like you could do with with a model if you can figure out how to have it do a definition query for each county that would then run a select by location function, then export. Maybe number the counties and have it step through the full sequence for the queries.
Rob, where can I learn more about modeling in ArcGIS? I looked in the help file, so I see that this task might be called a "process model" which is fairly obvious, and that I might use a "Series value" to identify each feature (e.g. county). But I don't see much about how to create a model. I'll keep looking.
BTW, that script I found above, that just explodes a single shapefile into its constituent features, which is great, but still one step away from doing what I want (take those individual features, clip another layer, and then export that).
#6
Posted 13 June 2008 - 01:57 PM
Esri
Product Engineer
Map Geek
#7
Posted 13 June 2008 - 02:46 PM
This is a perfect scenario for FME's fanout capabilities. After doing an overlay of counties on census tracts, you can automagically write out the census tracts to seperate files based on the county they're in.
If you can send me some sample data, I'd be more than happy to run a test for you.
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics
#8
Posted 13 June 2008 - 03:02 PM
It's been a while since I last mentioned FME, so here goes...
This is a perfect scenario for FME's fanout capabilities. After doing an overlay of counties on census tracts, you can automagically write out the census tracts to seperate files based on the county they're in.
If you can send me some sample data, I'd be more than happy to run a test for you.
OK Hans, you're on. I'm downloading the 14-day trial now.
EDIT: Very cool! I downloaded the trial, got the license, figured out what to use (WorkBench), read the help file, and ran a fanout process all in about 30 minutes! I didn't get it quite right. My result was just counties, but obviously I just "applied" the fanout to the wrong thing or missed a setting somewhere. So, what's the deal on pricing, I can't find anything on the official website?
#9
Posted 14 June 2008 - 12:27 PM
Cartographer, Bureau of Land Management
Oregon State Office
Portland, Oregon
pfyfield@blm.gov
#10
Posted 16 June 2008 - 07:56 AM
What I'm looking for here are the right words and terms to use to define what I am trying to do.
Example:
Load county shapefile for NJ. Load census tracts shapefile for NJ. Export 21 shapefiles, 1 per county, containing all census tracts inside each county.
I can do this manually, but of course there must be a way to automate it, without resorting to actual VB.NET or Python scripting. Either through a macro, an existing plug-in, or a script on the user-submitted scripts page.
I've been poking around the arcscripts.esri.com page, but apparently the terms I am entering are not what people use to describe this process.
In most cases splitting out something like this into separate shapefiles just complicates things and make stuff hard to manage. I would look into adding a field for county name to your census tract shapefile, populate this field and then do a definition query on this field. This way you only have to manage one dataset for whatever you are doing.
There is probably a script to do this but since you only have 21 counties it will probably take you longer to find the script than to just do it manually... It would take just a few minutes... For each county first select the county then go to Selection>>Select by Location. In this dialog choose select features from your census tracts that have their centroid in the county boundaries (Use selected county boundaries.) With this selection set you can either populate a county field in your census tracts dataset or export out to a new shapefile.
Hope this helps.
Rich
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

United States
Back to top

Netherlands








