Data Distribution for Raster Data

Sydney Dombowsky
Sydney Dombowsky
  • Updated

Introduction

This tutorial walks through the steps to create an FME Flow Data Download service to distribute raster data. The application will allow users to do the following:

  • Download specific tiles of Vancouver aerial imagery using the Geometry Parameter
  • Choose a raster format output
  • Choose between a grayscale and a color image
  • Build a raster pyramid with the selected number of levels
  • Create a thumbnail with a specified size

You will create this application using FME Workbench and FME Flow.

 

Files

 

Step-by-Step Instructions

Part 1: Load the Data

1. Start FME Workbench

When FME Workbench starts up, select New under Create a Workspace. Click Save and choose where you want to save your workspace. Call the workspace RasterDistribution.fmw. 

Download the RasterDataDownload.zip folder from the Files section above, then move it to the same location as your workspace.

 

2. Add a Creator Transformer

We will use the Creator transformer since we don’t have a Reader. If we did not have this, the workspace would not run. 

Add a Creator to the canvas and open the parameters to set the following:

  • Geometry Source: Geometry Object
  • Coordinate System: EPSG:4326

 

3. Add a User Parameter for the Geometry Parameter

We want to let the user specify the area on the map for which they want raster data. 

Under Navigator, right-click User Parameters. Select Manage User Parameters to open a new window. Click on the green plus icon, and in the drop-down options, select Spatial > Define Geometry.

Fill in the parameter with the following:

  • Parameter Identifier: GEOM
  • Label: Create Clipping Area
  • Required: Enabled
  • Visibility: Always Show
  • Geometry Encoding: GeoJSON
  • Geometry Types: Polygon
  • Specify initial bounds for map display: Enabled
    • Top: 49.2548
    • Left: -123.244
    • Bottom: 49.3034
    • Right: -123.071
  • Default Value: 
{"type":"Polygon","coordinates":[[[-123.109703,49.280212],[-123.089447,49.27954],[-123.09494,49.268788],[-123.110046,49.273492],[-123.109703,49.280212]]]}

Click OK.

 

4. Add a GeometryReplacer

The GeometryReplacer will change the raster image to the user-selected area using GeoJSON coordinates.

Add the GeometryReplacer and connect the Creator Created output port to its Input port. Open the parameters and set the Geometry Encoding to GeoJSON. The Geometry Source can be set to our new GEOM parameter by selecting the drop-down arrow and User Parameter. Click OK.

  • Geometry Encoding: GeoJSON
  • Geometry Source: $(GEOM)
    • Use drop-down menu to select user parameter

 

5. Match the Coordinate System with a Reprojector

We will use a Reprojector transformer to match the coordiante system of the user-selected area to the raster data. 

Add a Reprojector and connect its Input port to the GeometryReplacer Output port. In the parameters, enter the following:

  • Source Coordinate System: LL84
  • Destination Coordinate System: UTM83-10

Click OK.

 

6. Add Data with FeatureReader

Add a FeatureReader to the canvas and then connect the Reprojector Reprojected port to the FeatureReader Initiator input port. In the parameters, set the format as TIFF (Tagged Image File Format). 

We will temporarily set the Dataset to look for data locally to ensure everything runs smoothly. Click on the ellipsis and locate the file that contains all of the data. Select one of the images and click Open. Once this is added to your Dataset parameter, change the image file after /RasterData to /*.tif. This will allow the transformer to select any image in the folder. 

Set the following parameters:

  • Format: TIFF (Tagged Image File Format)
  • Dataset: /RasterDataDownload/RasterData/*.tif
    • Parameters:
      • Schema Attributes
        • Additional Attributes to Expose: fme_basename, char(50)
  • Feature Types to Read: TIFF
  • Spatial Filter: Bounding Boxes OGC-Intersect
  • Output Ports:
    • Specified: Enabled
      • TIFF

 

7. Add an AttributeExposer

We need to expose the fme_basename attribute using the AttributeExposer. This will give us some metadata information on the rasters. Connect the TIFF port of the FeatureReader to the AttributeExposer. In the parameter dialog, type fme_basename as the Attributes to Expose.

  • Attribute: fme_basename

 

8. Mosaic the Rasters

Add the RasterMosaicker and connect the FeatureReader TIFF output port to it. This will merge the raster images together. Leave the default settings as they are.

 

9. Run the Workspace

Before we continue, we must ensure the workspace is working properly. Run the workspace with Data Caching Enabled. On the FeatureReader, click on the TIFF green eye icon to view the data in Data Preview. The result should look like this:

Ensure the workspace has been saved and named RasterDistribution.fmw.

 

10. Upload the Data to FME Flow

Log in to your FME Flow account and in the Resources tab, click the Data folder. 

 

Open this folder and select Upload > Files to upload all the image files.

 

After the upload completes, return to the Data folder. Check the box next to the RasterData folder, then click Actions > Properties.

 

Copy the System Path and save it somewhere. We will use this path when we publish the workspace to FME Flow.

 

For detailed instructions on how to create a connection to FME Flow and upload workspaces, please see the section below:

  • To publish a workspace from FME Workbench to FME Flow, follow the generic instructions below using the specific details listed in the article. If the article does not have a specific repository name listed, we recommend creating a Training repository. If a specific service is not listed in the article, please use the default Job Submitter.

    1. Click Publish

    From the File menu, click Publish to FME Flow, or from the toolbar ribbon, click Publish.

    Toolbar Ribbon:


    File Menu:

    Deploy Menu (2025.1+):
    DeployToFlow.png

    2. Add a Web Connection

    In the Publish to FME Flow wizard, a FME Flow connection needs to be selected or created. To create an FME Flow connection, click the drop-down under FME Flow Connection and select Connect to FME Flow.

    The following instructions are for a basic connection, but if your FME Flow is set up for Microsoft Azure, SAML, or Windows Credentials, please see the Using Web Connections to Connect to FME Flow documentation.

    An FME Flow Connection dialog will appear; here, we will set up the connection. The connection information and credentials can be obtained from your FME Flow Administrator. If you have not yet logged into FME Flow after installing, please do so prior to continuing, as you will be prompted to change the password from the default:
    Username: admin
    Password: admin

    • • Web Service: FME Flow

      • Server URL: http://localhost

      • Connection Name: Training FME Flow

      • Authentication: Basic

      • Username: your username

      • Password: your password

      Click OK. FME will try to authenticate the connection. Once authenticated, this connection will be available whenever you publish a workspace. The connection will only need to be created once.

    • • Web Service: FME Server

      • Connection Name: Training FME Server

      • Server URL: http://localhost

      • Username: your username

      • Password: your password

      Click Authenticate. FME will try to authenticate the connection. Once authenticated, this connection will be available whenever you publish a workspace. The connection will only need to be created once.

      Click Next to move to the Create Repository page of the dialog

    3. Create Repository

    Repositories are used to store groups of related items that have been published to FME Flow (similar to directories). Items such as workspaces, source data, custom formats, custom transformers, and templates can be published to a repository.

    If you need to create a new repository, click on the New button next to Repository Name. Enter the repository name and an optional description. Click OK to close the Create New Repository dialog.

    To select an existing repository, click the drop-down next to Repository Name and select the desired repository.

    4. Upload Files

    Some workspaces require additional files to run correctly on FME Flow, so these need to be uploaded along with the workspace. To upload files, enable Upload data files at the bottom of the dialog.

    When files are uploaded through the publishing menu, they are stored within the repository. If you want to upload folder files (such as geodatabases) or to specify where the files stored, the Select Files button allows you to do that. For detailed instructions on how to use the Select Files button, see the documentation.

    5. Register Services

    The final step before publishing a workspace is to register services. Services control how the data will be output after the workspace is run.

    Services return results in different forms:

    • Data Download Service returns results as a downloadable zip file

    • Data Streaming Service returns results as a data stream

    • Job Submitter Service accepts and runs workspace job requests

    • KML Network Link returns a KML Network Link that can be used in Google Earth

    • Notification Service allows for event-driven messaging

    Typically, the Job Submitter is always enabled, but multiple services can be enabled. Once services have been enabled, click Publish.

    6. Review Translation Log

    To confirm whether or not the workspace was published successfully, check the Translation Log. The Translation log will show which repository you published to, which files were included, and a quick link to run the workspace.

 

Part 2: Create Conditions

11. Create Grayscale User Parameter

Right-click User Parameters in the Navigator and select Manage User Parameters. Click the green plus icon, then select Choice. Set the parameters as follows:

  • Parameter Identifier: Greyscale
  • Label: Output as Greyscale
  • Visibility: Always Show
  • Choice Configuration: Dropdown
    • Choice 1:
      • Value: Yes
      • Display: Yes
    • Choice 2:
      • Value: No
      • Display: No
  • Allow Users to Enter a Custom Value: No
  • Default Value: Yes

 

12. Create Thumbnail User Parameter

Create another Choice parameter using the following parameters:

  • Parameter Identifier: Thumbnail
  • Prompt: Create Thumbnail
  • Required: Enabled
  • Visibility: Always Show
  • Choice Configuration: Dropdown
    • Choice 1:
      • Value: Yes
      • Display: Yes
    • Choice 2:
      • Value: No
      • Display: No
  • Allow Users to Enter a Custom Value: No
  • Default Value: Yes

Click OK to close the Parameter Manager. 

 

13. Filter the User Thumbnail Choice

The user can create a thumbnail. We need to create a filter for that to make the workspace do what we want. 

Add a TestFilter transformer and connect the RasterMosaicker Output port to it. Open the parameters dialog. Fill out the Test Condition by double-clicking into the If/Test Condition box, and also fill in the Output Port Else box.

In the If/Test Test Conditions dialog, enter the following parameters:

  • Test Clause 1:
    • Left Value: $(Thumbnail)
    • Operator: =
    • Right Value: Yes
  • Output Port: Thumbnail

Click OK. In the main TestFiler Parameters dialog, set the Else/Output Port to No Thumbnail:

  • Else/Output Port: No Thumbnail

Click OK to close the TestFilter Parameters.

 

14. Filter the Image Choice

Add a second TestFilter to the canvas and connect both the Thumbnail and No Thumbnail ports from the first TestFilter to the second one. Fill out the first Test Condition by double-clicking on the box under it. In the If/Test Test Conditions dialog, enter the following parameters:

  • Test Clause 1:
    • Left Value: $(Thumbnail)
    • Operator: =
    • Right Value: Yes
  • Output Port: Grayscale

Click OK. Double-click into the Else If/Test box. In the Test Conditions dialog, set:

  • Test Clause 1:
    • Left Value: $(Thumbnail)
    • Operator: =
    • Right Value: No
  • Output Port: Color

 

Part 3: Create Thumbnail Image

15. Create a thumbnail-sized user parameter

In the User Parameters, right-click and select Manage User Parameters. Click the green plus icon, then select Number. Fill in the parameters as follows and make sure Required is unchecked:

  • Parameter Identifier: PERCENTAGE
  • Prompt: Thumbnail Size (as percentage)
  • Required: Disabled
  • Visibility: Always Show
  • Default Value: 1

Click OK.

 

16. Add a RasterResampler

Add a RasterResampler and connect the TestFilter Thumbnail output port to it. This transformer will create a thumbnail image of the raster with the user-specified size.

In the parameters dialog, set the following:

  • Resolution Specification: Percentage
  • Percentage: $(PERCENTAGE)
    • Use the drop-down menu to select the user parameter

 

17. Add an AttributeCreator

We will create a new attribute value to add to the metadata for any thumbnail images. Add an AttributeCreator and connect the RasterResampler Resampled output port to it. 

Open the parameters and add the following new attribute:

  • Output Attribute: fme_basename
    • Use the drop-down to select this attribute
  • Value: @Value(fme_basename)_thumb
    • Click the ellipsis to open the Text Editor, then paste the above value inside

Click OK twice.

 

Part 4: Create a Grayscale Image

18. Add a RasterExpressionEvaluator

Add a RasterExpressionEvaluator and connect the TestFilter Grayscale output port to the RasterExpressionEvaluator A input port.

To create a greyscale image from a color image, we need to multiply each band (red, green, and blue) by an expression. 

In the RasterExpressionEvaluator parameters, set the following band expressions:

  • Band Expression 1:
    • Interpretation: Red8
    • Expression: 0.2989*A[0] + 0.5870*A[1] + 0.1140*A[2]
  • Band Expression 2:
    • Interpretation: Green8
    • Expression: 0.2989*A[0] + 0.5870*A[1] + 0.1140*A[2]
  • Band Expression 3:
    • Interpretation: Blue8
    • Expression: 0.2989*A[0] + 0.5870*A[1] + 0.1140*A[2]

 

 

19. Run the Workspace

Click on the RasterExpressionEvaluator and select Run to This from the pop-up menu. Click Run again in the Translation Parameter Values window (ensure that the Grayscale parameter is set to Yes)

Check the result by clicking on RasterExpressionEvaluator and selecting the green eye icon. Your result should look like this in the Data Preview Graphics window:

 

Part 5: Convert Raster from Three Bands to One

This part of the workflow will only run if the user chooses a GIF format, since it does not support 3 bands. 

 

20. Create Output Format User Parameter

Right-click User Parameters in the Navigator and select Manage User Parameters. Add a Choice parameter. This parameter will allow the user to choose a format for their output raster. 

The values for each format are the short name of the Writer type. If you want to add a format but are not sure of the short name, you can search for the Writer, and the short name will be listed. 

Fill in the parameters. Instead of manually filling in the Choice Configuration table, you can select Import > Writer Formats to add multiple formats at once.

  • Parameter Identifier: OutputFormat
  • Label: Output Format
  • Required: Enabled
  • Visibility: Always Show
  • Choice Configuration: Dropdown
    • Choice 1:
      • Value: GEOTIFF
      • Display: GeoTIFF (Geo-referenced Tagged Image File Format)
    • Choice 2:
      • Value: GIFRASTER
      • Display: GIF (Graphics Interchange Format)
    • Choice 3:
      • Value: JPEG
      • Display: JPEG (Joint Photographic Experts Group)
    • Choice 4: 
      • Value: PDF2D
      • Display: Adobe Geospatial PDF
    • Choice 5:
      • Value: PNGRASTER
      • Display: PNG (Portable Network Graphics)
  • Allow Users to Enter a Custom Value: No
  • Default Value: GeoTIFF (Geo-referenced Tagged Image File Format)

 

21. Add a Third TestFilter

Add a third TestFilter and connect the RasterExpressionEvaluator Result output port and the TestFilter_2 Color output port to the TestFilter_3 Input port:

In the parameters dialog, double-click into the If/Test definition box. In the Test Conditions dialog, enter the following:

  • Test Clause 1:
    • Left Value: $(OutputFormat)
      • Use drop-down menu to select user parameter
    • Operator: =
    • Right Value: GIFRASTER
  • Output Port: GIFRASTER

Click OK. In the Else/Output Port box, set:

  • Else/Output Port: Other Formats

 

22. Add a RasterPaletteGenerator

The RasterPaletteGenerator transformer will merge three of the bands into one. Add this transformer to the canvas and connect the TestFilter_3 GIFRASTER output port to it. 

View the parameters for the RasterPaletteGenerator. We will leave them as the default since our bands are 8-bit as well.

 

23. Duplicate Objects

Since there are two streams of transformers that will feed into the writer, we also need to convert the thumbnail stream to an 8-bit raster if the user chooses GIF as the raster format.

To do so, select both the TestFilter_3 and RasterPaletteGenerator transformers, then right-click and select Duplicate. 

 

Reconnect the TestFilter_4 GIFRASTER output port to the RasterPaletteGenerator_2 Input port. Connect the TestFilter_4 Input port to the AttributeCreator Output port that was added in Part 3. 

 

Part 6: Create Raster Pyramid

We will need to create a raster pyramid if the user chooses to have that.

24. Create a User Parameter for the Pyramid

In the Navigator, right-click on User Parameter and select Manage User Parameters. Click the green plus icon, then select Choice. Fill in the parameters as follows:

  • Parameter Identifier: Pyramid
  • Label: Create Raster Pyramid
  • Required: Enabled
  • Visibility: Always Show
  • Choice Configuration: Dropdown
    • Choice 1:
      • Value: Yes
      • Display: Yes
    • Choice 2:
      • Value: No
      • Display: No
  • Default Value: No

 

 25. Add a Fifth TestFilter 

Add a fifth TestFilter and connect the RasterPaletteGenerator Output port and the TestFilter_3 Other Formats output port to it.

We will want to test for the condition where the user wants a pyramid, and they have not selected the PDF output format. In the parameter dialog, double-click the box under If/Test Condition. Fill out the condition as follows:

  • Test Clause 1:
    • Left Value: $(Pyramid)
    • Operator: =
    • Right Value: Yes
  • Test Clause 2:
    • Logic: AND
    • Left Value: $(OutputFormat)
    • Operator: !=
    • Right Value: PDF2D
  • Output Port: Pyramid

Click OK. Set the Else/Output Port as No Pyramid. Click OK.

  • Else/Output Port: No Pyramid

 

26. Create a User Parameter for Pyramid Levels

Right-click on User Parameters and open the Manage User Parameters. Click the green plus icon, then choose Number. Fill in the parameters as follows (make sure required is unchecked):

  • Parameter Identifier: NUMBER_OF_LEVELS
  • Label: Number of Levels in Pyramid
  • Required: Disabled
  • Visibility: Always Show
  • Lower Limit: None
  • Upper Limit: None
  • Numeric Precision: Integer
  • Default Value: 3 

 

27. Add a RasterPyramider

Add a RasterPyramider and connect the TestFilter_5 Pyramid output port to it. This transformer will create the number of levels specified by the user.

Open the parameters and set the following:

  • Smallest Level Size or Number of Levels: Number of Levels
  • Number of Levels: $(NUMBER_OF_LEVELS)
    • Use the drop-down button to select the user parameter

Click OK.

 

28. Add a Second AttributeCreator 

Here, we will create a new metadata attribute for any image that has a pyramid. Add a second AttributeCreator and connect the RasterPyramider Pyramids output port to it. 

Open the parameters for the transformer and set the following:

  • Output Attribute: fme_basename
  • Value: @Value(fme_basename)_pyraLvl_@Value(_pyramid_level)
    • Click the ellipsis to open the Text Editor dialog

 

Part 7: Add Writer

In our workspace, we want a writer that will use the same format as the user specified. 

 

29. Add a Generic (Any Format) Writer

Add a Generic (Any Format) writer to the canvas with the following parameters:

  • Format: Generic (Any Format)
  • Dataset: /Output
    • Browse to an output location to download the data
  • Parameters:
    • Output Format: Generic (Any Format)

 

Click OK twice. The Feature Type dialog will pop up. In the User Attributes tab, set the Schema Definition to Manual then add a geometry definition with the type set to fme_any:

  • Schema Definition: Manual
  • Geometry Definition:
    • Name: <geometry>
    • Geometry Type: fme_any

 

Click OK and connect the following transformer ports to the NewFeatureType writer:

  • TestFilter_4 Other Formats output port
  • RasterPaletteGenerator_2 Output port
  • TestFilter_5 No Pyramid output port
  • AttributeCreator_2 Output port

 

In the Navigator, right-click Output [GENERIC] and select Edit ‘Output [GENERIC]’ Parameters. We will set the output format to the same as the user specified.

  • Writer Parameters:
    • Output Format: $(OutputFormat)
      • Use the drop-down arrow to select the user parameter 

 

We want to ensure the writer does not appear as a user parameter in the application. Right-click User Parameters in the Navigator and select Manage User Parameters. Select the DestDataset_GENERIC parameter and adjust the following parameters:

  • Required: Disabled
  • Visibility: Always Hide

Click OK.

 

Double click the NewFeatureType writer on the canvas. We will change the Feature Type Name.

  • Feature Type Name: fme_basename
    • Use the drop-down menu to select the Attribute Value

 

30. Run Workspace

Before you run the workspace, make sure the order of your User Parameters in the Navigator. You can rearrange the parameters from the Navigator window or in the Manage User Parameters dialog. Order them as follows:

  • [OutputFormat]
  • [Grayscale]
  • [Pyramid]
  • [NUMBER_OF_LEVELS]
  • [Thumbnail]
  • [PERCENTAGE]
  • [GEOM]
  • [DestDataset_GENERIC]

 

Click the dropdown arrow next to the Run button and select Run the Entire Workspace. The Translation Parameter Values should look like this by default:

Click Run.

To check your result, click on the writer feature type to open the pop-up menu and select the Folder button. This should take you to the folder that contains the final raster image. 

Final workspace:

 

Part 8: Building Workspace App

31. Change Local Path to System Path

Open the FeatureReader Parameters and paste the System Path we copied earlier (in Part 1) in the Dataset parameter. Append /* to the path so it looks like the following:

  • Dataset: $(FME_SHAREDRESOURCE_DATA)/RasterData/*

When you change from local path to FME Flow system path, you will get a few errors in the Translation Log about the folder location being accessed. We can ignore these as they will not be an issue once we publish the workspace to FME Flow.

Reconnect the transformers connection lines. Connect the FeatureReader <Generic> output port to the AttributeExposer Input port and the RasterMosaicker Input port.

 

32. Publish the Workspace

In FME Workbench, from the top Toolbar, click Publish button. 

 

You may have to remove the FME Flow Parameter value for FME_SHAREDRESOURCE_DATA within the Navigator in order to publish succesfully.

 

In the Publish to FME Flow dialog, select your FME Flow Connection or add a connection. Create a new repository called RasterDistribution.

  • FME Flow Connection: <your connection name>
  • Repository Name: 
    • New:
      • Repository Name: RasterDistribution
  • Workspace Name: RasterDistribution.fmw

Click Continue.

In the Register Services page, enable the following services:

  • Data Download
  • Data Streaming
  • Job Submitter

We are using the Data Download because the user can download raster data. Since our data is on FME Flow, we want to use Data Streaming. In this case, we are also using Job Submitter to run the workspace we published.

Click Publish.

 

33. Create the App

Go to FME Flow and select Flow Apps from the side menu. In the Flow Apps window, under the Workspace Apps tab, click Create or Create Workspace App.

 

In the Create Workspace App dialog, enter the following App Details:

  • Name: RasterDistribution
  • Title: Data Distribution for Raster Data
  • Description:  Allows users to select an area and download raster data according to their preferences. The user can specify the output format, thumbnail choice, color choice, pyramid choice, and number of pyramid levels.
  • Repository: RasterDistribution
  • Workspace: RasterDistribution.fmw
  • Service: Data Download 

 

You can set the App Security to Private or Publish under the App Access heading. Open the Parameter Defaults drop-down menu. Review the parameters and ensure they include all the user parameters we specified. 

Click Create. Open the URL provided or click the View App button.  

 

The app should look like this:

 

Additional Resources

Getting Started with FME Flow Workspace Apps [Article]

Using the Geometry Parameter [Article]

 

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.

 

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.