AnsweredAssumed Answered

Python help needed... select polygons from one shapefile, based on values in another table...

Question asked by johnswood on Jan 7, 2015
Latest reply on Jan 9, 2015 by filipkral

I have a table in a geodatabase with the following field names (types):


SpeciesNum (String)

Sci_Name  (String)

Spp_number (String)

Sum_A1  (Long)

Sum_A2 (Long)

Sum_A3 (Long)

Sum_H2 (Long)

Sum_H3 (Long)

Sum_H4 (Long)

Sum_H5 (Long)

Sum_H6 (Long)



I also have a shapefile with regions A through G, subdivided into depth classes 1-6…. Each of the 48 polygons is coded A1, A2, A3….H5, H6. Field Name is ‘Code’ (String).


I want to select polygons from the shapefile, based on whether the corresponding field in the table has a ‘1’ or a ‘0’ value. So if Sum_A1 and Sum_A2 both contain ‘1’s, the A1 and A2 polygons will be selected. I then want to export the selected polygons as a new shapefile with the name from Sci_Name, and a field containing the SpeciesNum (a string value).


Since I have about 13,000 species, each of which should become a separate shapefile, I need to automate this process. 


Oh yeah, I’m working in ArcMap 10.2, with Python 2.7. Any help or helpful fragments ware greatly appreciated! I am new to the Forums, so I've probably just broken all sorts of protocols. I apologize in advance!