Select to view content in your preferred language

Raster to Polygon within Model - inline variable error

7083
10
01-05-2015 03:57 PM
JenniferRoath
Deactivated User

I created a model to iterate through and process rasters and convert the desired value field to a polygon. The final model needs to be robust and very user friendly.

However, when I try to use an inline variable to put the polygon into a user defined temp geodatabase the tool will add ".shp" to the output file name. Unless it is pathed to a gdb in the model it will add the ".shp" But since the output is really a gdb, it causes an error during the run.

The problem:

I've been getting around this by making the polygon output into a parameter and changing the location myself each run. But then it's not exactly user friendly.

How I "fix" the problem:

How can I prevent the automatic addition of ".shp" on this step? And leave out my work-around solution so the eventual user only defines a temp gdb?

(None of the other steps have this issue with the inline variable)

Thanks

10 Replies
curtvprice
MVP Esteemed Contributor

I suggest using the built in variable %scratchGDB% - guaranteed to exist and be writable, set the output of Raster To Polygon to be %scratchGDB%\xxtemp, and then then use Copy Features after that to copy the output of Raster To Polygon to an output feature class set as (output parameter). Model Builder

Managing intermediate (scratch) data in shared model and script tools—Sharing geoprocessing workflow... 

Using scratchGDB