AttributeValueMapper
查找 and assigns attribute values based on other attributes, and stores the looked-up value in a new attribute.
This transformer does not modify feature types.
Input Ports
The feature type that contains the source attribute to be mapped.
Output Ports
Features with the mapped source attribute stored in a new attribute.
Parameters
Attribute Selection
The attribute whose values will be mapped.There is limited support for null, missing, and empty string values.Please refer to the附加价值设置section below.
The attribute that will store the looked-up value.You can use the default name, or specify a new attribute name.Alternatively, you can type the name of an existing attribute, or even the Source Attribute.If an existing attribute or the Source Attribute is specified, the existing value of the attribute is overwritten.
The value to give the目标属性if the value of the来源属性is not found in the价值图table.The reverse is true when映射方向is set to反向(目的到源)。There is limited support for null, missing, and empty string values.Please refer to the附加价值设置section below.
The default value can be a constant or computed value (such as an attribute value), the value of a user parameter, the value of a system parameter, or an expression containing the above.
You can also enter a default value containing the word键(uppercase), where键will be substituted by the value of the来源属性。If, for example, you have entered a default value ofKEY-0and the来源属性has a valuedthat is not in the mapping table, the destination attribute value will be set tod-0because键is replaced by the original valued。
If left blank and matching values are not found, an empty string is assigned.
Mapping Parameters
Determines whether values will be mapped from the来源属性to the目标属性, or vice-versa.
价值图
This table of values specifies the mapping information.
When the映射方向is set to转发(源到目的地), if the value of the来源属性is specified in the来源值column, the目标属性will be created with the value specified in the目标值column corresponding to that source value.
This process is reversed if the映射方向is set to反向(目的到源)。
The来源值and目标值can be a constant value or a computed value such as an attribute value, the value of a user parameter, the value of a system parameter, or an expression containing the above.
You can import attribute values (source value, destination value, or both) from any FME-supported source dataset.
The most common use would be to import from the same dataset that is being mapped, but you can also import the mappings from a lookup table stored in a text, CSV or Excel file, or another dataset.
Click the Import button and pick Source Value, Destination Value, or both.A wizard will step you through the import procedure:
- 选择的格式和数据集被读取。点击下一步。
- 下一个窗格显示与数据集关联的要素类型的列表。数据集中的特点将被扫描,发现该属性值将被加入到AttributeValueMapper属性列表。点击下一步。
- 选择关键属性。该属性的值应该与对入境的AttributeValueMapper要素的属性。点击下一步。
- 选择属性的值。该属性的值将被添加到AttributeValueMapper。点击下一步。
- 状态会显示有多少功能进行扫描,以及独特的属性值的总数中。点击导入,包括在表中的值。
附加价值设置
This section contains documentation common to默认值,来源值, and目标值。
空值: When chosen under来源值, source null values will be mapped to a destination value.When chosen under目标值, the source value will be mapped to a null destination value.The reverse is true when映射方向is set to反向(目的到源)。
没做什么: No action will be taken.When mapping in-place, this means the source attribute value will be preserved.Otherwise, this means no destination attribute will be created for the source value specified.
停止翻译: When the specified source value is encountered, halt translation with the specified message.Useful when you wish to halt translation on unexpected attribute values, such as null values.
When mapping from source to destination, there are three attribute values that are不supported by the默认值parameter or the价值图table.它们是:缺少,空,空字符串值。例外情况在下面说明。
提示:如果你需要映射或从空,丢失或为空字符串值,可以考虑使用NullAttributeMapper。
是可能的映射源空值,或一个源值映射到零,或以指定空的默认值,当空值被指定为一个常数。要指定一个空值作为默认值,源或目标价值,遵循这个截图:
此外,可以将源值映射到空字符串的目的地值,或指定空字符串作为默认值。注意,如果一个缺失或无效值被指定为经由属性的目的地值或默认值,它会被转换成一个空字符串。
Example
This example maps the values "Non-Residential" and "Residential" of thetype
attribute to a new attribute,category
, with values "N" and "R", respectively.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace.More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers.To access a menu of these options, clickbeside the applicable parameter.For more information, seeTransformer Parameter Menu Options。
Transformer Categories
Transformer History
This transformer was previously named the ValueMapper.
Search FME Knowledge Center
Search for samples and information about this transformer on theFME Knowledge Center。
标签Keywords: ValueMapper