RasterSubsetter

From fmepedia

RasterSubsetter is a Workbench Transformer.

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

Dmitri's raster studio also has a more advanced example using this and the RasterMosaicker to create a raster collage.


The RasterSubsetter

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



Above: RasterSubsetter Example Workspace.

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



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.



Above: This is what the source data originally looked like.



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!

Attached Files
filesizedate
RasterSubsetterExample.zip1.2 MB08/19/09
RasterSubsetterExample1.jpg41.6 kB08/19/09
RasterSubsetterExample1a.jpg18.5 kB08/19/09
RasterSubsetterExample2.jpg86.2 kB08/19/09
RasterSubsetterExample3.jpg55.9 kB08/19/09
User Comments Add a new comment