RasterPyramider
From fmepedia
RasterPyramider is a Workbench Transformer.
| Table of contents |
Description
Creates a series of pyramid levels for each input raster feature by specifying either the smallest pyramid level size or the number of pyramid levels to generate. Pyramid levels are created by resampling input rasters to various different resolutions.
Example
The attached workspace shows an example use of the RasterPyramider transformer.
NB: This is actually a good illustration of working with raster data in general, and GeoTIFF data in particular, because it uses some useful functions and techniques that have a wider use and that the average user might not be aware of.
The RasterPyramider

Above: RasterPyramider Example Workspace.
The workspace reads a CDED format DEM, pyramids it and converts to GeoTIFF.

Above: This close-up of the RasterPyramider highlights that the smallest raster will be 24x24 pixels in size.
So the first raster to be created will be resampled to be 24x24 pixels in size. Each subsequent raster will be twice the resolution giving 48x48, etc...
When the size of the original raster is reached then the pyramiding process stops.
In this example the original raster size is 1201 x 1201 pixels. The smallest raster will be 24 x 24. Therefore the raster pyramids will be...
24 x 24 48 x 48 96 x 96 192 x 192 384 x 384 768 x 768 1536 x 1536
...giving a total of seven pyramid layers.

Above: The feature counts show how the one image has been split into seven layers.
File Naming
By default the output from this process would be a series of files bearing the same name as the source data.

Above: The default output files.
However, the RasterTiler outputs a layer number which we can combine with a constant using the Concatenator to produce a new output filename.

Above: Concatenator settings dialog.
By default filenames are obtained from the source format attribute fme_basename using a feature type fanout on that attribute. Therefore a new filename is applied by simply changing the fanout to use the new concatenated name attribute.

Above: Updated fanout setting.
When the fanout is applied like this the output files are named using our newly created attribute.

Above: Filenames Created from Concatenated Attribute..
With the newly named output files it's worth noticing:
- How each level starting at 6 and counting down increases in size.
- How the first layer is layer 0 (not 1)
- How the number truly relates to the pyramid layer (the default file naming would incorrectly reverse the numbering)
Viewing the Output
The output can then be opened in the FME Viewer to be inspected.

Above: Level6 (the smallest raster) as shown in the Viewer.

Above: Don't bother trying to count the pixels - the query tool tells us it really is 24x24.

Above: The entire sequence of levels.
NB: This example was carried out on only a single raster dataset. Usual practice for pyramiding is to have multiple tiles. If the data is not already tiled this could be done using the RasterTiler transformer. See this page for an example of that technique.
