Files
Introduction
The RasterConvolver is a transformer that applies a convolution filter to raster data. Convolution filters are applied using a kernel, specified as a matrix of weights for neighboring values. Filtering can be used to smooth, sharpen, and enhance edges, as well as for other raster image manipulation operations.
Data Source
The source dataset is an orthophoto of the City of Vancouver, stored as a GeoTIFF.
Additional files are available on the right-hand side of this article.
- RasterNeighborhoodFunctions.zip (23.9 MB)
Step-by-step Instructions
In this scenario, you are interested in applying a convolution filter in order to sharpen a GeoTIFF image. For more information on Raster processing using the RasterConvolver, check out the Edge Detection with the RasterConvolver article or the Raster Slope Calculations as a RasterConvolver Example article.
1. Create a New Workspace
Open FME Workbench and create a blank workspace.
2. Add a GeoTIFF Reader
Add a reader to the canvas by clicking on the Reader button on the top menu bar or by going to Readers > Add Reader. In the Add Reader dialog, set the following:
- Format: GeoTIFF
-
Dataset: BCVANC15_O7.tif
- Click on the ellipses to navigate to the location of the file on your computer
Click OK to add the reader to the canvas.
3. Add a RasterConvolver
Click on the GEOTIFF reader feature type to select it. Then add a RasterConvolver transformer to the canvas by typing “RasterConvolver” to bring up the list of FME Transformers in the Quick Add Search. Select the RasterConvolver from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it.
Double-click on the RasterConvolver to open the parameters. In the parameters, set the following:
-
Filter:
- Convolution Filter: Sharpen 3
- Preserve Band Interpretation: Yes
Click OK
By default, the preserve band interpretation is set to No; leaving it at No would convert the Red, Green, and Blue bands of the GeoTIFF to Real64 (i.e., convert to a grayscale image).
4. Run Workspace
Connect an Inspector transformer to the Output port on the RasterConvolutor.
Run the workspace by clicking the Run button on the top toolbar, or by selecting Run > Run Workspace from the top menu bar.
After running the workspace, the output will be sharpened. Try picking another filter from the RasterConvolver’s predefined convolution filters or enter your own values by setting the Convolution Filter to User Defined and entering Kernel Weights.
Data Attribution
The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.