import arcpy from arcpy import env env.workspace = r"C:\temp\python\test.gdb" env.overwriteOutput = True fc = "Airports" rows = arcpy.SearchCursor(fc) for row in rows: x = row.OBJECTID arcpy.MakeFeatureLayer_management(fc, "fc_lyr", "OBJECTID = " + str(x)) rows2 = arcpy.SearchCursor("fc_lyr") for row2 in rows2: XMIN = row2.shape.extent.XMin YMIN = row2.shape.extent.YMin XMAX = row2.shape.extent.XMax YMAX = row2.shape.extent.YMax YMIN2 = row2.shape.extent.YMin + 10 orig_coord = str(XMIN) + " " + str(YMIN) y_axis = str(XMIN) + " " + str(YMIN2) corner_coord = str(XMAX) + " " + str(YMAX) arcpy.CreateFishnet_management("Fishnet_" + str(x), orig_coord, y_axis, "0", "0", "2", "2", corner_coord, "NO_LABELS", "", "POLYGON") del row, rows, row2, rows2
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.