Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, arcpy, numpy
- from arcpy import env
- arcpy.env.overwriteOutput = True
- def unique_values(table, field):
- with arcpy.da.SearchCursor(table, [field]) as cursor:
- return sorted({row[0] for row in cursor})
- agloms=unique_values(r'C:UsersgdornaDropboxCIPUVlilpProyecto LILP 2014 - InfraestructuraLincoln Infra - GISIterate aglomsagloms.gdbpais','AGLOMERADO')
- i=0
- for lugares in agloms:
- arcpy.SelectLayerByAttribute_management("pais","NEW_SELECTION",""""AGLOMERADO" = 'lugares'""")
- arcpy.CopyFeatures_management('pais', "a_" + `i`)
- print `lugares` + "----->" + `i`
- i=i+1
- for lugar in agloms:
- print lugar
- BAHIA BLANCA
- CIPOLLETTI
- CONCORDIA
- FORMOSA
- GRAN CORDOBA
- arcpy.SelectLayerByAttribute_management("pais","NEW_SELECTION",""""AGLOMERADO" = 'lugares'""")
- arcpy.SelectLayerByAttribute_management("pais","NEW_SELECTION", ""AGLOMERADO" = '" + lugares + "'")
Add Comment
Please, Sign In to add comment