Il y a 3 polygones dans shp. fichier.comment passer d'un polygone à l'autre dans un fichier en python?
besoin de trouver min/max de coordonnées pour chacun. Je peux le faire que pour 1 par suivant:
import arcpy # csv
from arcpy import env
print "Creating and defining variables."
env.workspace = r"C:\Users\Desktop\data"
env.overwriteOutput = 1
theme = 'interestAreas.shp'
# Look for .next() in SearchCursor, need a loop
# the same when we read line by line
for i in theme:
Curs = arcpy.da.SearchCursor(theme, '[email protected]').next()
polygon = Curs[0]
ext = polygon.extent
del Curs
# Find min X, Y and max X, Y for each polygon and write it to the file:
print 'xmin is: ', ext.XMin
print 'ymin is: ', ext.YMin
print 'xmax is: ', ext.XMax
print 'ymax is: ', ext.YMax
minX = ext.XMin
minY = ext.YMin
Comment le faire en utilisant pour ou en arcpy et la boucle? Ou comment se déplacer dans l'ID (1,2,3) de polygones?
Nous vous remercions de votre aide.