Basic Raster Mosaicking

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2023.2

Introduction

Using the RasterMosaicker transformer, multiple source raster files may be mosaicked into a single file. Source rasters must all have the same number of bands and, in turn, the same number of palettes. In this basic example, we will mosaic four raster files with the same number of bands. For a more advanced example that deals with rasters without the same number of bands, please visit the Raster Mosaicking Scenario article.

Note: The data used in this step-by-step tutorial is available in the files section of this article (top right).

 

Step-by-Step Instructions

1. Read in Four JPEG2000 Orthophotos

In a blank workspace, add an OpenJPEG JPEG2000 Reader to the canvas. Browse to and select all four JPEG2000 files that we will mosaic together (BCVANC15_N5_A.jp2, BCVANC15_N5_B.jp2, BCVANC15_N5_C.jp2, and BCVANC15_N5_D.jp2) for the dataset (optionally, you can read in just the .zip folder too).

 

2. Inspect the Data

Before mosaicking, it is worth looking at the imagery and noting a few things about these files. Run the translation (make sure Feature Caching is enabled). In Visual Preview (if it does not show, select the green magnifying glass on the Reader), the rasters appear as though they are mosaicked together, but if you drag and select a corner of the image, you can see only a quarter of the image gets selected.

quarter-raster-selected.png

 

 

3. Mosaic the Rasters Together

Back in FME Workbench, add a RasterMosaicker transformer. Since the images all line up together with no gaps or overlaps and all of them have the same spacing, they can be mosaicked together with the default settings in the RasterMosaicker.

rastermosaiker-transformer.png

 

 

4. Write Out to One GeoTIFF

Add a GeoTIFF writer to the canvas and connect it to the Output port on the RasterMosaicker. In the GeoTIFF parameters, set the Raster File Name to CoalHarbor. Run the workspace. The result looks like the second image below.
geotiff-writer-parameters.png

 

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 - British Columbia.

 

In the next exercise, learn how to use NoData and Alpha bands to remove black borders.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.