Generation

generate functionTue, 30 May 2023

generar un codigo en arcpy para leer los extend de capas en una gbd que tiene dataset y exportar a archivo tipo texto

import arcpy import os def agrega(a,b): return a+b def datos(a,b): arcpy.env.workspace = b capas = arcpy.ListFeatureClasses() for capa in capas: print "Processing " + capa arcpy.env.outputCoordinateSystem = arcpy.SpatialReference(3116) ext = arcpy.Describe(capa).extent xmin = ext.XMin xmax = ext.XMax ymin = ext.YMin ymax = ext.YMax a.write(capa + "," + str(xmin) + "," + str(ymin) + "," + str(xmax) + "," + str(ymax) + "\n" ) del xmin, xmax, ymin, ymax del capas

Questions about programming?Chat with your personal AI assistant