FME Server Data Upload: Publish From FME Workbench

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2022.1

Introduction

We want to be able to update a map weekly to indicate sports field status. This workspace takes a CSV file containing field availability and combines it with a MapInfo Tab file containing park polygons in the city of Vancouver. The field status can change each week, so we want to create a workspace that reads the newest CSV file and generates the updated KML file without having to modify the workspace each time. This can be done with user parameters and FME Server.
 

Step-by-step Instructions

Part 1: Setup the CSV Reader with a User Parameter

We’ll need to do some preparation before we can upload the workspace to FME Server.
 
1. Open the Template File and Create a User Parameter

Download the starting workspace and data from the Files section on this article. Open up the CheckFieldStatus.fmwt in FME Workbench. Expand the CSV Reader in the Navigator Pane. Right-click on the Source CSV file parameter and select “Create User Parameter”.
Create Parameter

In the Add/Edit User Parameter dialog, change the Prompt to “Field Status CSV File:”. Clear the Default Value and click OK.
Add Parameter

Notice in the Navigator Pane, that the cog wheel next to the Source CSV file name has turned red. This is ok because we haven’t added a CSV file yet; once we add a file, it will turn pink. The parameter we just created can be found under User Parameters in the Navigator pane.
New Parameter

2. Choose a Location for the Output KML File

Expand the OGCKML writer in the Navigator Pane. Double-click Destination Google KML File parameter.
Choose Location

Browse to the location where you want the output KML file written and click OK.
Chosen KML Location

3. Run the Translation

To run the workspace, first, we need to ensure that Prompt for User Parameters is enabled, so we can add the new CSV file as a User Parameter. On the top toolbar, click the drop-down next to Run. If Prompt for User Parameters does not have a checkmark next to it, click to enable it.
Prompt for Parameters

Once Prompt for User Parameters is enabled, click Run to run the workspace. The Translation Parameters dialog will appear. In the dialog, browse to and select the weekendsportsfieldstatus.csv file. Uncheck ‘Save As User Parameter Default Values’ - we do not want to provide a default location for the user running the workspace, since it may be different each time. Click Run.
Do not save defaults

 
4. Inspect the Data

After running the workspace, click on the FieldStatus writer to view the popup menu. Select the folder icon which will open the containing folder with the KML data in it.
Inspect the output

In the file browser, double-click on the FieldStatus.kml in Google Earth, if you have it installed, otherwise you can open your data in Visual Preview without the additional popup information. As you can see, the workspace added stylings so that the closed fields are red, and the open fields are green. If you click on a park polygon, a popup dialog will appear with information about the status, closure notice, and last updated date.
Viewing KML in Google Earth

 

Part 2: Publish Workspace to FME Server


1. Create a FME Server Connection

Back in FME Workbench, click on the Publish to FME Server tool or File > Publish to FME Server. 
Publish to FME Server

In the Publish to FME Server dialog, click the drop-down next to Connection and select Add Web Connection, then enter your FME Server credentials. Click Next. For more detailed instructions on creating an FME Server connection, see Publish a Workspace to FME Server and Run It.
 
2. Create a New Repository

Click New next to Repository Name, we will create a new repository named Data Upload Tutorial, then for the description enter “Workspace repository for the Data Upload Tutorial”, click OK.
Create Repository

Notice that by default “Upload data files” is checked. 
Upload data files

Take a look at which files are being uploaded. Click on “Select Files”. The Parks files are all from the MapInfo dataset. Leave those checked. Uncheck the CSV file at the bottom, because remember, we want the user to provide the CSV file for this workspace. Click OK until you are back to the Publish Workspace dialog. Then click Next.
Choose Files
 
3. Select Services to Register

Make sure your workspace is registered with the Data Download, Data Streaming, and the Job Submitter services. This will allow a job with the workspace to be submitted on FME Server and the resulting KML file to be downloaded or streamed to a webpage by the user. Click Publish to publish the workspace to FME Server.
Register Services
 
Continue to Data Upload with FME Server: Direct Upload to continue the exercise where we will run the workspace in FME Server and download a zip file containing the data.

 

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?

Comments

0 comments

Please sign in to leave a comment.