Batch convert raster to polygon

2290
4
Jump to solution
04-19-2021 07:33 PM
mlopezr95984
New Contributor III

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

 

0 Kudos
2 Solutions

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

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.


... sort of retired...

View solution in original post

Luke_Pinner
MVP Regular Contributor

Easiest is to right-click the Raster to Polygon (Conversion) tool and select "Batch"

Luke_Pinner_0-1618893457292.png

 

View solution in original post

4 Replies
DanPatterson
MVP Esteemed Contributor

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.


... sort of retired...
mlopezr95984
New Contributor III

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= raster

arcpy.RasterToPolygon_conversion(In_v, outRaster + str(b) +".SHP", "NO_SIMPLIFY","VALUE")

Luke_Pinner
MVP Regular Contributor

Easiest is to right-click the Raster to Polygon (Conversion) tool and select "Batch"

Luke_Pinner_0-1618893457292.png

 

DanPatterson
MVP Esteemed Contributor

Batch geoprocessing—ArcGIS Pro | Documentation

which is kindof like modelbuilder... but check the requirements to see if it suits your needs


... sort of retired...
0 Kudos