Raster to Raster Translation (Geotiff to JPEG) with Reprojection

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2023.2

Introduction

This article intends to show the steps for generating a workspace to read a GeoTIFF raster image file, convert it to a JPEG2000 raster image file, and then reproject it from one coordinate system to another.

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. Generate the Workspace

Start FME Workbench. In the Start tab, choose the ‘Generate Workspace’ option.

generate-workspace.png

 

In the Generate Workspace dialog, fill in the following:

Reader:

  • Format: GeoTIFF (Geo-referenced Tagged Image File Format)
  • Dataset: <your file path>\06-07-NO.tif

 

Writer:

  • Format: JPEG 2000 (GeoJP2/GMLJP2)
  • Dataset: <your file path>\Output

generate-workspace-dialog.png

 

2. Run the Translation

Once the workspace is generated, click on the green play button in the toolbar to run the translation.

run-button.png
 

3. Inspect the Output

Inspect the output by right-clicking on the writer feature type and choosing the Inspect option or by clicking on the writer feature type and clicking on the Inspect button in the popup menu.

writer-feature-menu-options.pngselect-writer-feature-context-menu.png

Visual Preview will open, and a pre-filled dialog will be displayed. Click the ellipsis button to the right of Dataset and navigate to the newly created 06-07-NO.jp2 file to select it.

confirm-window-view-data.png

 

4. Determine Coordinate System

The entire image is selected automatically; you can see information about the raster in the Feature Information window, including the coordinate system, cell spacing, extents, cell origin, and bands. Note that the coordinate system is UTM83-10. If the image is not selected automatically or the image is unselected (clicked outside the image area), click and hold your mouse button outside the image and drag the box anywhere on the image to show the properties of the raster; a blue box will appear around it.

visual-preview-raster.png

 

Note: To view your raster image with a basemap, click the drop-down menu above the graphics view area (Background map off).

 

5. Reproject the Raster into LL84

Add a CsmapReprojector transformer after the GeoTIFF feature type reader. The CsmapReprojector will be used to change the projection from UTM83-10 to LL84. Leave the Source Coordinate System parameter as "Read from feature" in the parameters, as the coordinate system is already set to UTM83-10 on the source. Set the Destination Coordinate system to "LL84".

CsmapReprojector-transformer.png

 

6. Update the Filename to Reflect Reprojection

Add a StringConcatenator transformer and connect it to the Reprojected Output port on the CsmapReprojector. We will use the StringConcatenator to concatenate "_LL84" to the fme_basename (which is a format attribute generated by FME that stores the output JPEG2000 name).

In the parameters, in the drop-down menu for New Attribute, select fme_basename. Then, for the String Type, select Attribute Value, then set the String Value to fme_basename. On a new line in String Parts, select Constant for the String Type and set the String Value to _LL84. This will append _LL84 to the Source GeoTIFF file name. Click "OK" and connect it to the writer feature type.

StringConcat-transformer.png

 

7. Run the Workspace and Inspect the Output

Rerun the workspace (Run button drop-down arrow > Rerun Entire Workspace). Inspect 06-07-NO_LL84.jp2 with Visual Preview (Same process as step 3). The coordinate system in the Feature Information window should now be in LL-WGS84.

feature-information-window.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.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.