Saturday 26 December 2015

arcgis desktop - Iterating feature class output file names using ModelBuilder?


I am trying to iterate a series of feature classes (polygons) in model builder to convert a series of polygons to rasters, however, I am having an issue with the output file names.


After inserting the "iterate feature class" tool into the model builder window, and linking my gdb storing all the polygons as the input, the output feature (green bubble) automatically becomes the name of my first polygon. As a result the model that I attempt to run seems to recur to that named polygon rather than then going to the next polygon in the list. Output rasters are created, but overwrite that file name rather than generating a new raster with a new name that matches the subsequent polygons.


What am I doing wrong?



Answer



Here is the model, it uses inline substitution as described by Aaron. Note the output of the Polygon to raster tool is ..\fGBD_Scratch.gdb\ras_%Value%. Value is coming from the iterator which in this case was set to FID to hand out unique rows. So the first raster dataset would be ras_1, then ras_2, etc.


Model


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...