Jun-11-2017, 04:35 AM
(This post was last modified: Jun-11-2017, 04:35 AM by babakkasraie.)
Hello
I have a grid shapefile that contains 10 polygon squares.
I need to select each tile (which is a row in the attribute table) and make a separate shapefile. It means I need to create 10 separate shpefiles from the grid.
How can I make a loop to go through rows and select each row and make a polygon shapefile out of it?
I tried the following codes unsuccessfully.
Thanks for help.
I have a grid shapefile that contains 10 polygon squares.
I need to select each tile (which is a row in the attribute table) and make a separate shapefile. It means I need to create 10 separate shpefiles from the grid.
How can I make a loop to go through rows and select each row and make a polygon shapefile out of it?
I tried the following codes unsuccessfully.
Thanks for help.
# Import arcpy module import arcpy # Local variables: This is the Grid Mapsheet_grid_50K = "Mapsheet_grid_50K" # The following loop is supposed to go through rows rows = arcpy.SearchCursor(Mapsheet_grid_50K) row = rows.next() while row: Expression = "\"FID\" = row" #This expression is used is the following select method arcpy.Select_analysis(Mapsheet_grid_50K, Mapsheet_grid_50K_Select_shp, row)# This select method will select each tiles # This is a separated single tile Mapsheet_grid_50K_Select_row_shp = "F:\\Canada_DSM_ForTestOnly\\PersonalData&Maps\\map_Tiles\\Mapsheet_grid_50K_Select."+row+".shp" del row del rows