span8
span4
span8
span4
Previous: Tutorial: Data Upload with FME Server | Next:Data Upload Part 1: Direct Upload
We want to be able to update a map weekly to indicate sports field status.This workspace takes a CSV file containing information about whether the field is open to use or closed for use and combines it with a MapInfo Tab file containing park polygons in the city of Vancouver.Field status can change each week,so we want to create a workspace that reads the up to date CSV file and generate the updated KML file without having to modify the workspace each time.This can be done with user parameters and FME Server.
We'll need to do some preparation before we can upload the workspace to FME Server.
1.Open template file and create a User Parameter
Open up the CheckFieldStatus.fmwt and expand the CSV Reader in the Navigator Pane.Right-click on the Source CSV file parameter and select "Create User Parameter".
Create User Parameter in the Navigation Pane
In the Add/Edit User Parameter dialog,click the drop-down menu for the Type field,and change this to "Filename (existing)".Change the Prompt to "Field Status CSV File:",change the Attribute Assignment to Off,click ok.
Edit the parameter,change the type to Filename(Existing)
Notice in the Navigator pane,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 > Published Parameters in the Navigator pane.
Parameter we just created in the User Parameters in the Navigation Pane
2.Run the Translation
To run the workspace,first we need to ensure that Run with Prompt is enabled,so we can add the new CSV file to the User Parameter.On the top toolbar,click the question mark icon,or go to Run > Run with Prompt.Then click the Run button.
Run with Prompt option in the toolbar
In the Translation Parameters dialog,browse to and select the weekendsportsfieldstatus.csv file,click ok and the workspace will run.
Add the weekendplayfieldstatus.csv file in the Translation Parameters dialog
3.Inspect the data
Click on the FieldStatus writer,the popup menu appears,select the folder icon which will open the containing folder with our KML data in it,or select the magnifying glass to inspect the data in the Data Inspector.
Inspect the FieldStatus KML output using the Data Inspector
Then open FieldStatus.kml in Google Earth.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.
FieldStatus.kml output in Google Earth
1.Create FME Server Connection
Back in FME Desktop,click on the Publish to FME Server tool or File > Publish to FME Server.
Publish to FME Server icon in the toolbar
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.
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.
Notice that by default "Upload data files" is checked.Take a look at which files are being uploaded.Click on "Select Files…".The Parks files are all from our MapInfo dataset.Leave those alone.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.
Select only the Parks files to upload,uncheck weekendplayfieldstatus.csv
3.Select services to register to
Make sure your workspace is registered with the Data Download,Data Streaming,and the Job Submitter services.Click Publish to publish the workspace to FME Server.
Register to the Data Download,Data Streaming and Job Submitter services
The data used here originates from open data made available by the City of Vancouver,British Columbia (data.vancouver.ca).It contains information licensed under the Open Government License - Vancouver.
Continue toData Upload Part 1: Direct Upload to continue the exercise where we will run the workspace in FME Server and download a zip file containing our data.
Getting Started with FME Desktop: Introduction to FME Data Inspector
Getting Started with FME Desktop: Modify Attributes
Getting Started with FME Desktop: Adding Transformers
FME Fails to Connect to Socrata
How to Convert DWG to DGN (AutoCAD to Microstation)
Creating a Polygon from Line Segments
Changing Raster Values by Geographic Feature
© 2019 亚搏在线Safe Software Inc |Legal