Hello,
I have several raster files in a folder. I would like to convert them to polygons. Is there a way to run a batch?
Thank you
Easiest is to right-click the Raster to Polygon (Conversion) tool and select "Batch"
Iterate Rasters (ModelBuilder)—ArcGIS Pro | Documentation
Raster to Polygon (Conversion)—ArcGIS Pro | Documentation
in a model in modelbuilder...
However, "several"? By the time you get the model running and tested, you could have probably done it manually several times over.
If this is a repetitive task then consider modelbuilder, but a python script would probably faster.
Thank you Dan, this worked!
from arcpy import env#Set environment settings
env.workspace = r"C:\Users\MD\Documents\Geos\RECLASS_FILES"
rasters = arcpy.ListRasters("*", "TIF")for raster in rasters:
a= (str(raster))b= (a[:-4])outRaster = (r"C:\Users\MD\Documents\Geos\RASTER_TO_POLY\CAT10")In_v= rasterarcpy.RasterToPolygon_conversion(In_v, outRaster + str(b) +".SHP", "NO_SIMPLIFY","VALUE")
Batch geoprocessing—ArcGIS Pro | Documentation
which is kindof like modelbuilder... but check the requirements to see if it suits your needs
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.