I have started to use FME more and more for data imports and data processing. I like automating any workflow as much as possible, and FME is great for this. For one part of a project had a number of similar raster processes that could be defined in a single workspace, as long as parameters could be used.
The system documentation is normally both detailed and clear, and FME also has very good support and community web sites. However in this case it took a lot of documentation reading and trial and error to work out how to change the ouput filename of a model. This may be obvious to experienced users of FME, but it had me stumped for a while.
The steps involved are simple in retrospect, and are as follows:
Create your raster model as normal, but add an additional AttributeSetter transformer, as shown in the screenshot above.
Next create a new Published Parameter that will be used to pass in the output raster filename. The source dataset and destination folder can also be set to be published parameters to provide full flexibility.
Next right click on the newly created published parameter and check the AttributeSetter value item. This creates the link between the parameter and the value for the attribute.
If you look at the AttributeSetter’s properties they should now look similar to below.
Finally look at the properties for your output raster dataset. Make sure the “Fanout By Attribute” is checked and the attribute is set to fme_basename. This sets the output filename to be the same as the fme_basename attribute value, which is now set via an input parameter.
The model is now ready to run from the command line or through a batch process, for one or many raster transformations. The output filename parameter does not require a .tif extension.
fme.exe raster_sample.fmw --SourceDataset_ARCVIEWGRID C:\Grids --DestDataset_GEOTIFF C:\Rasters --OutputFileName MyOutputRaster