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
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.