Tried to use model builder to convert several rasters to polygons. Here is the script exported to Python:
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# convertraster.py
# Created on: 2017-04-24 11:38:52.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Load required toolboxes
arcpy.ImportToolbox("Model Functions")
# Local variables:
copiesx = "C:\\Documents\\GIS\\temp\\copiesx"
tx_107_tif = "C:\\Documents\\GIS\\temp\\copiesx\\tx_107.tif"
v_name__shp = "C:\\Documents\\GIS\\temp\\shapx\\%name%.shp"
# Process: Iterate Rasters
arcpy.IterateRasters_mb(copiesx, "", "", "NOT_RECURSIVE")
# Process: Raster to Polygon
arcpy.RasterToPolygon_conversion(tx_107_tif, v_name__shp, "NO_SIMPLIFY", "Value")
I've restarted ArcMap (10.2. ) several times because the model keeps failing with the following message:
ERROR 010157: Unable to open feature class ... Failed to execute (Raster to Polygon).
I checked the error code. '... This may be due to incorrect paths or lack of permissions to access folders.' Don't think it's that, I know where the files are and made them myself, I have the permissions. It also says that the files could be corrupt, but I can load the files without problem. I executed one Raster to Polygon outside the model and it worked. Any guesses how to get the model to work?