span8
span4
Parameters control how FME operates: how data is read in, transformed and written out using various FME components. This article will explain the different types of published parameters available within FME as well as go through an example on how to create a published parameter.
有两种类型的FME公布的参数:FME参数和用户参数。
FME参数are built into the FME Workbench interface and directly control the translation. Examples of FME Parameters include the WHERE clause, Search Envelope coordinates, and Character Encoding.
FME参数
User Parameters顾名思义旨在用于一个工作区的用户。这些参数由工作区笔者在翻译用户输入创建的。这些可以被绑定到FME参数,给出关于阅读器,变压器,或写入器用户有限的控制。用户参数可以被链接到提供值以在工作空间中的变压器和属性。
有两种类型的用户参数,发表和私人。已发布的参数是由最终用户可见的,而一个秘密参数是由作者创造的工作区中看到。用户参数是默认选项。设置一个参数是不可选的手段,用户必须输入一个值,否则FME将无法运行转换。
User Parameters
在该实例中的工作区中,AreaCalculator用于计算每个公园(ParkArea)的面积。然后StatisticsCalculator用于组基于它们属于(市区,锦绣等)附近的公园和计算每个邻域的平均面积。
通过使用发布的参数,工作区提示用户决定是否AverageNeighborhoodArea被通缉。按照下面的步骤使用示例工作区来创建一个发布的参数,或者审查的最后工作区看到所使用的参数。
1.打开工作区中FME工作台
Open the Example Template workspace in FME Workbench.
工作区概述
2.创建发布的参数
Right click on User Parameters in the Navigator and select Create User Parameter… The following dialog will appear:
创建用户参数
There are numerous options for the Type of a User Parameter:
文字可以处理普通文本的值,
Multi-line Text should be used for values that require encoding provided the rest of the translation supports it
数字类型处理整数和浮点值。
Choice provides the user with a list of options to pick.
Choice with Alias can be used to provide more user-friendly choices (i.e.- an employee name can be used as an alias for an ID number)
将类型设置为选择与别名和名称AverageArea。该提示是什么FME将显示给用户,输入“包括相邻单元平均值:”作为提示。
取消选择可选,这迫使用户输入的翻译运行的选择。
点击配置椭圆形按钮。在这里,我们就可以进入我们的用户的选择和别名。显示名称是用户看到的内容,并应体现出价值。设置显示名称为“Yes,包含”。和值设置为“Y”。将第二个选择“不,不要包含”。和“N”。
创建AverageArea用户参数
属性赋值can be left on Default. Click OK to create the parameter. Once the parameter has been created, it can be accessed throughout the workspace and can be edited by right clicking on it and selecting Edit Definition… in the User Parameters > Published Parameters section of the Navigator Pane.
在用户参数右键单击要编辑的定义
3.测试用户参数
The Tester transformer is used to evaluate the newly created AverageArea parameter. In the Tester parameters, set the Left Value to the User Parameter: AverageArea. This can be done by clicking the drop-down and expanding User Parameter then selecting AverageArea or by typing $(AverageArea) in the text box. Then set the Operator to =, and the Right Value to Y.
选择在测试变压器AverageArea用户参数
Tester transformer parameters
4.设置工作区来运行提示
It is important to set the workspace to Run With Prompt, so the User Parameter prompt is displayed. On the top menu bar either click the Run With Prompt shortcut icon or go to Run > Run With Prompt.
当工作区运行与发布的参数会出现一个对话框。
Run With Prompt dialog to access the AverageArea User Parameter
数据归属
这里使用源自从公开数据中的数据由提供温哥华市, 不列颠哥伦比亚省。它包含了开放政府许可协议进行许可信息 - 温哥华。
©2020安全亚搏在线软件公司|法律