I am new to programming and scripting in general, so please bear with me. I have generated a list of the location of all the shapefiles for my workplace. The files are all placed in folders, no geodatabases are used. I am trying to create a tool which queries which of the shapefiles intersect another shapefile. I would like to use the list as one of the inputs for the intersect parameters. I want to:

  1. Calculate the area of the intersected features
  2. perform stats
  3. If area of intersect > 0, convert the original data to feature layer
  4. clip the feature layer and save as new fc in target location.

I would really appreciate some python script examples as to go about this task.

I am using arcGIS 10 with an arcView license.

Thank you.

  • When you say I'm new to programming, does that mean that you don't have any experience at all? Rather than write the script for you I can give you some pointers, but I need to know that you understand basic control structures and such. An explanation of what you're trying to accomplish would be helpful; it seems like copying shapefiles that intersect into gdb is somewhat arbitrary. – Roy May 16 '12 at 17:33

When I was picking up Python for ArcGIS, I came across the PSU Master's in GIS Open Courseware. This particular lesson covers spatial queries with feature layers. I highly recommend the whole course, though, it covers syntax, loops, conditionals, functions, cursors, etc.

The courses also include exercises (with answers & video explanations) so you can practice using the queries and update attribute tables with cursors.

  • Thanks a lot Roy. This is definitely something that can benefit me. – Visceral May 16 '12 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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