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.
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)
I am using a file geodatabase. The problem is that when I tell the "raster to polygon" tool to create the output polygon features as %temp%\%val%_poly it will append .shp to the file name. However, %temp% is a geodatabase and doesn't allow .shp
I've been getting around this by setting the output as a parameter and telling it to create the feature as E:\temp.gdb\%val%_poly each time I run the model.
My final version can't ask the user to include an inline variable.
%val% is already a parsed path variable. The tool itself will append .shp to the file name if it doesn't read .gdb in the file path. This happens when I set up the tool in the model and have only been able to change it manually as a parameter later when I try an run it.
Ok - I found a solution (posting in case someone reads this later with a similar problem)
1) Model parameter = Results Folder (not a gdb like I had it set up to do)
2) First Step in the model - create "Temp" GDB in the user defined Results Folder
3) In the raster to polygon tool, have the output feature polygon be %Results_Folder%\Temp.gdb\%val%_poly
The tool requires the output path to have .gdb or it will append .shp to the name. This accomplishes that without having to manually change the path.
Thanks everyone for the help!
Hello Ms. Jennifer Roath, I have similar problem to what you posted last year. The shapefiles in my ModelBuilder like for example in my attached image, the raster to polyline is having an error when I run the model. Based on your posted solution, I should have create a folder that is not inside the File Geodatabase am I right? Thank you.