AttributeValueMapper
Looks up 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 theAdditional Value Settingssection 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 theDestination Attributeif the value of theSource Attributeis not found in theValue Map表格The reverse is true whenMapping Directionis set toReverse (Destination to Source). There is limited support for null, missing, and empty string values. Please refer to theAdditional Value Settingssection 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 an FME parameter, or an expression containing the above.
You can also enter a default value containing the wordKEY(uppercase), whereKEYwill be substituted by the value of theSource Attribute. If, for example, you have entered a default value ofKEY-0and theSource Attributehas a valuedthat is not in the mapping table, the destination attribute value will be set tod-0becauseKEY是代表laced 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 theSource Attribute到Destination Attribute, or vice-versa.
Value Map
This table of values specifies the mapping information.
When theMapping Directionis set toForward (Source to Destination), if the value of theSource Attributeis specified in theSource Valuecolumn, theDestination Attributewill be created with the value specified in theDestination Valuecolumn corresponding to that source value.
This process is reversed if theMapping Directionis set toReverse (Destination to Source).
TheSource ValueandDestination Valuecan be a constant value or a computed value such as an attribute value, the value of a user parameter, the value of an FME 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:
- Select the format and dataset to be read. Click Next.
- The next pane displays the list of feature types associated with the dataset. The features in the dataset will be scanned, and the attribute values found will be added to the attribute list in the AttributeValueMapper. Click Next.
- Choose the key attribute. The values of this attribute should match the attribute on features that are entering the AttributeValueMapper. Click Next.
- Choose the value attribute. The values of this attribute will be added to the AttributeValueMapper. Click Next.
- The status will show how many features were scanned, and the overall number of unique attribute values found. Click Import to include the values in the table.
Additional Value Settings
This section contains documentation common toDefault Value,Source Value, andDestination Value.
Null: When chosen underSource Value, source null values will be mapped to a destination value. When chosen underDestination Value, the source value will be mapped to a null destination value. The reverse is true whenMapping Directionis set toReverse (Destination to Source).
Do Nothing: 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.
Stop Translation:当遇到指定源值,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 arenotsupported by theDefault Valueparameter or theValue Map表格它们是:v失踪,空,空字符串alues. The exceptions are noted below.
Tip: if you need to map to or from null, missing, or empty string values, consider usingNullAttributeMapper.
It is possible to map a source null value, or to map a source value to null, or to specify a default value of null, when the null value is specified as a constant. To specify a null value as the default, source, or destination value, follow this screenshot:
Further, it is possible to map a source value to a destination value of empty string, or to specify the empty string as the default value. Note that if a missing or null value is specified as a destination value or default value via an attribute, it will be converted into an empty string.
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.
TagsKeywords: ValueMapper