attributevaluemapper.
将属性值与查找表进行比较,并为找到匹配的新值。映射值可以存储在新属性中,或覆盖现有属性,包括原始源。
Typical Uses
- 基于用户定义的查找表添加或更改属性值
- Cleaning up attribute values
- 为属性创建替代,编码值
它是如何工作的?
attributevaluemapper由用户定义的查找表驱动 - 该Value Map。选择一个源属性,与查找表相比,它将具有其值以映射新值。新值可以存储在新属性(默认行为)中,或者可以覆盖现有属性(包括源属性)。
值映射可以手动创建或通过导入任何支持的任何FME支持的数据集。导入对于使用已经包含源和目标值(例如电子表格)的预定义地图特别有用,并且用于扫描数据集以查找给定属性的所有现有值。
如果在Value Map中找不到属性值,则将分配新属性,默认值,可能留空。
额外的值设置
Default Value,源价值, 和Destination Valuecan be set to a fixed value, or can use an FME predefined value. In the case of Source and Destination values, these may be set per line in the Value Map table, and so different attribute values may prompt different actions.
Values available are:
无效的 | 源价值:源空值将映射到目标值。 Destination Value: The source value will be mapped to a null destination value. The reverse is true if映射方向被设置为反向(Destination to Source). |
Do Nothing | 没有任何行动将被采取。映射到位时(即,如果新值覆盖源值),则源属性值将被保留。 否则,将不会为指定的源值创建目标属性。 |
停止翻译 | 如果遇到指定的源值,请使用指定的消息停止转换。当您希望在意想不到的属性值上停止翻译,例如空值。 |
Support for Null, Missing, and Empty String Values
从源从源到目的地映射时,存在三个属性值notsupported by theDefault Value参数或参数Value Map桌子。他们是:missing,无效的, 和空字符串价值观。例外情况如下。
通过使用“参数下拉”菜单上可用的空常数,可以映射或指定null的默认值。
此外,可以将源值映射到空字符串的目标值,或者将空字符串指定为默认值。
请注意,如果缺少或空值被指定为目标值或默认值通过属性, it will be converted into an empty string.
例子
In this example, we want to map an attribute in our bike path dataset. The original data has an attribute calledPathType, with values ofS,M, 和L。
该功能被路由到attributevaluemapper中。
In the parameters dialog, we selectPathTypeas theSource Attribute, keep the default目的地属性name_looked_up.,并分配一个Default Value的Unknown(将用于任何具有的功能PathTypenot found in our lookup table).
对于我们可能的源属性值中的每一个,我们在其中创建一个值对Value Map。
输出功能现在具有新的属性,_looked_up., containing the mapped values.
在这个例子中,我们有一个食品供应商的数据集,其中DESCRIPTION属性值具有许多错误和样式差异,例如大写。我们还希望将其与更广泛类别结合起来的值。
该功能被路由到attributevaluemapper中。In order to find all possible values in the dataset, we will use the进口在参数对话框中向导。
第一步是选择要导入的数据集 - 选择我们想要清理的相同数据集。
请注意,在第二个对话框中 -指定导入模式- we need to change the进口ModetoAttribute Values。
接下来,在选择属性对话框,我们指定了源价值asDESCRIPTION。We are not importingDestination Values(as we might if loading a predefined value map), and so it is left blank. Click进口完成。
为所有现有值扫描数据集,它们已加载到Value Map。Then we complete theDestination Value桌子的一侧。注意以下选择:
- 所有变化Hot Dogs(热狗,HotDogs,热狗等等)被映射到Hot Dogs。
- Several values that are already in the desired form (印度菜肴,意大利美食) 有<没有动作>分配给他们,因此不会改变。
- 有些相关类型分配了一个常见名称,因此将组合(韩国美食,墨西哥菜)。
请注意,目标属性与源属性相同。This will result in the new values overwriting the original values (except for those denoted as
清理的输出功能反映了所需的变化。
使用说明
- 如果您需要映射到空,丢失或空字符串值,请考虑使用nullattributemapper.。
配置
输入端口
菲atures with attributes to be mapped.
输出端口
具有映射属性的功能,存储在新的或现有属性中。
Parameters
Source Attribute | The attribute whose values will be mapped. |
目的地属性 | 将存储查找值的属性。您可以使用默认名称,或指定新的属性名称。或者,您可以键入现有属性的名称,包括源属性。如果指定了现有属性或源属性,则会覆盖属性的现有值。 |
Default Value | The value to give the Destination Attribute if the value of the Source Attribute is not found in the Value Map table. The reverse is true when Mapping Direction is set to Reverse (Destination to Source). 默认值可以是常量或计算值(例如属性值),用户参数的值,FME参数的值,或包含上述的表达式。 您还可以输入包含Word键(大写)的默认值,其中键将被源属性的值替换。例如,如果输入了key-0的默认值,并且源属性具有不在映射表中的值d,则目标属性值将设置为d-0,因为键被原始值替换天。如果找不到左移空白和匹配值,则会分配空字符串。 |
映射方向 | Determines whether values will be mapped from the Source Attribute to the Destination Attribute, or vice-versa. This may be useful when switching directions, without having to recreate the entire lookup table reversed. | ||||||
源值和目标值 | This table of values specifies the mapping information. 当映射方向设置为向前(源到目标)时,如果在源值列中指定了源属性的值,则将使用与该源值相对应的目标值列中指定的值来创建目标属性。 This process is reversed if the Mapping Direction is set to Reverse (Destination to Source). 源值和目标值可以是常量值或计算值,例如属性值,用户参数的值,FME参数的值,或包含上述的表达式。 |
||||||
进口 | 您可以从任何FME支持的源数据集导入属性值(源值值,目标值或两者)。 This is commonly used to import all existing values from the dataset that is being mapped, or to import a predefined lookup table (often stored in a spreadsheet or text file). Click the Import button to launch the Import Wizard, and follow the prompts.
|
Editing Transformer Parameters
使用一组菜单选项,可以通过引用工作区中的其他元素来分配变压器参数。一些变压器也可提供更高级的功能,例如高级编辑器和算术编辑器。要访问这些选项的菜单,请单击除适用的参数旁边。有关更多信息,请参阅变压器参数菜单选项。
定义值
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
算术编辑器提供了一种方便的方法来构建来自各种数据源的数学表达式,例如属性,参数和特征函数,其中结果直接在参数内使用。
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
内容
表达式和字符串可以包括许多函数,字符,参数等。
设置值 - 无论是否直接在参数中输入或使用其中一个编辑器和包含字符串的表达式都是构造的,都会评估这些函数的字符串和表达式。因此,这些函数的名称(以@ <function_name.>) should not be used as literal string values.
These functions manipulate and format strings. | |
Special Characters |
文本编辑器中提供了一组控制字符。 |
两个编辑器都有数学函数。 | |
Date/Time Functions | 文本编辑器中提供日期和时间函数。 |
这些运算符可在算术编辑器中使用。 | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
创建和修改用户参数 | 创建自己的可编辑参数。 |
对话框选项 - 表格
具有桌面参数的变压器具有填充和操作值的其他工具。
行重新排序 |
启用后,单击行项目后。选择包括:
|
Cut, Copy, and Paste |
启用后,单击行项目后。选择包括:
Cut, copy, and paste may be used within a transformer, or between transformers. |
筛选 |
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
进口 |
导入使用从数据集读取的一组新属性填充表。特定应用在变压器之间变化。 |
重置/刷新 |
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
不te:不t all tools are available in all transformers.
参考
Processing Behavior |
|
菲ature Holding |
不 |
Dependencies | 没有任何 |
Aliases | valuemapper. |
History | 以前名为ValueMapper. |
FME Community
FME社区是演示亚搏国际在线官网,TOS,文章,常见问题和更多的地方。获取您的问题的答案,从其他用户学习,并建议,投票和评论新功能。
Search for所有结果都是关于attributevaluemapper的结果on the FME Community.
例子may contain information licensed under the Open Government Licence – Vancouver and/or the Open Government Licence – Canada.