RasterSubsetter

The attached workspace shows an example use of the RasterSubsetter transformer.

About the RasterSubsetter

The RasterSubsetter extracts a subset of a rasters feature(s) based on pixel numbers, rather than a spatial reference system.

User-added image
Above: RasterSubsetter Example Workspace.

The attached workspace reads a CDED format DEM, creates a subset, and writes it to GeoTIFF.

User-added image
Above: This close-up of the RasterSubsetter highlights the settings.

In this example:
  • The source is 1200 x 1200 pixels in size
  • The subset (extract) of data will be 800 x 800 pixels in size
  • The origin point of the extract with be position 200,200 (in pixels) counting from the top-left corner
  • A nodata border 50 pixels in size will be added to all sides of the extract

Viewing the Output

The output can then be opened in the FME Viewer to be inspected.

User-added image
Above: This is what the source data originally looked like.


User-added image
Above: This is the extract (inner black box represents the 50 pixel border, outer black box the size of the original feature).


NB: The differences in colour range in the two images are caused by the Viewer calculating a scale separately for each raster. This only occurs because these are numeric rasters which need colour interpretation to be viewed: the underlying data is perfectly correct! Colour rasters would not exhibit the same differences because they would not need special interpretation. If you wanted to visualize this data with a continuous colour scale you could add a RasterInterpretationCoercer to the workspace before the RasterSubsetter to coerce everything into Grey8 (as opposed to Int8) - however refining the display like this would render the data useless as a DEM!