FME Version
Files
-
- 4 MB
- Download
Introduction
This article will 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.
The data used in this step-by-step tutorial is available in the Files section of this article.
Step-by-Step Instructions
In this step-by-step tutorial, you'll learn how to convert from one raster format to another and reproject it to another coordinate system.
1. Generate the Workspace
Start FME Workbench. In the Get Started pane, choose the Generate Workspace option or File > Generate Workspace.
In the Generate Workspace dialog, fill in the parameters as shown below:
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
2. Run the Translation
Once the workspace is generated, click Run the green play button in the menubar) to run the translation.
3. Inspect the Output
You can inspect the output by right-clicking on the writer feature type on the canvas and choosing the View Written Data... option from the context menu or by left-clicking it and selecting the View Written Data... icon in the popup menubar above.
A pre-filled dialog will be displayed. Click the ellipsis button (...) to the right of the Dataset parameter and navigate to the newly created 06-07-NO.jp2 file to select it. Visual Preview will display the raster and its information in the Feature Information window.
If no information is displayed in the Feature Information window, it's usually because the raster has yet to be selected. To show the raster's properties, click and hold your mouse button outside the image and drag the box anywhere on the image; a colored box will appear around it.
4. Determine Coordinate System
The Feature Information window contains information about the raster, including the Coordinate System, cell spacing, extents, cell origin, and bands. The Coordinate System is UTM83-10.
To view your raster image with a basemap, click the drop-down menu in the Visual Preview menubar that displays Background map off (shown above).
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 parameter to "LL84".
6. Update the Filename to Reflect the Reprojection
Add a StringConcatenator transformer and connect it to the Reprojected Output port of the CsmapReprojector transformer. We will use the StringConcatenator transformer to concatenate "_LL84" to the fme_basename attribute.
Double-click on the StringConcatenator transformer. Expand the drop-down menu for the New Attribute parameter in its parameters and select "fme_basename". Then, choose "Attribute Value" from the drop-down menu in the String Parts parameter table under the String Type column. Then, set the String Value column to "fme_basename" from the drop-down menu. On a new row in the String Parts parameter table, select "Constant" under the String Type column and set the String Value column to "_LL84". This will append "_LL84" to the Source GeoTIFF file name. Click OK and connect it to the writer feature type.
7. Run the Workspace and Inspect the Output
Rerun the workspace (i.e., Run > Rerun Entire Workspace). Inspect 06-07-NO_LL84.jp2 (follow the same process as Step 3). The Coordinate System in the Feature Information window should now be LL-WGS84.
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 - Vancouver.
Comments
0 comments
Please sign in to leave a comment.