AttributeCreator
将一个或多个属性添加到该功能,并可选择分配源自常量,属性值和表达式的值。值可以引用相邻的功能。
Typical Uses
- Add a new attribute to a feature and assign it a value
- Add a new empty attribute to a feature for use elsewhere in the workspace
How does it work?
Blank rows are provided where you can enter new attribute names and (optionally) set values for them. One or more new attributes may be added, and all features that pass through the transformer are modified according to these selections.
顶部添加了新属性。未识别重复的名称,并且不再多于一次。
- 在这个例子中,three new attributes are added to the input features:
- 已添加更新并设置为常量值“smith”。
- 添加X和Y,并通过用FME函数提取几何来设置到特征的坐标。
新的属性。的时候反映在要怎么变换r, at the top of the attribute list.
The attribute values are updated, and can be viewed in the Data Inspector’s table view.
Adjacent Feature Attributes are accessed under Advanced: Attribute Value Handling. When turned on, you can specify a number of features preceding and following the current feature to reference in calculating new values.
Suppose we are given the dataset below:
ID |
Latitude |
Longitude |
---|---|---|
0 |
49.1640 |
-123.061 |
1 |
49.1643 |
-123.063 |
2 |
49.1642 |
-123.062 |
3 |
49.1642 |
-123.064 |
If theNumber of Prior Featuresand后续功能的数量parameters are both set to 2, then when the first feature is read, the AttributeCreator has access to the following features:
Feature Reference |
ID |
Latitude |
Longitude |
---|---|---|---|
feature[-2] |
<缺失> |
<缺失> |
<缺失> |
feature[-1] |
<缺失> |
<缺失> |
<缺失> |
目前的功能 |
0 |
49.1640 |
-123.061 |
feature[+1] |
1 |
49.1643 |
-123.063 |
feature[+2] |
2 |
49.1642 |
-123.062 |
Note that some attributes are missing because no features exist prior to the first feature.
After the second feature is read, the window of prior and subsequent features available to the AttributeCreator shifts to produce the following:
Feature Reference |
ID |
Latitude |
Longitude |
---|---|---|---|
feature[-2] |
<缺失> |
<缺失> |
<缺失> |
feature[-1] |
0 |
49.1640 |
-123.061 |
目前的功能 |
1 |
49.1643 |
-123.063 |
feature[+1] |
2 |
49.1642 |
-123.062 |
feature[+2] |
3 |
49.1642 |
-123.064 |
This statement would calculate the average latitude of the two preceding features:
Calculations referencing adjacent features can be created in the Arithmetic Editor and the Text Editor. These editors will list the attributes of the currently processed feature first, then the prior features, then the subsequent features.
Usage Notes
- 考虑使用AttributeManager反而
Configuration
输入端口
此变形器接受任何功能。
Output Ports
Features with the new attributes and optionally defined values.
Parameters
When an AttributeCreator is opened for the first time, this area will contain a blank row where a new attribute can be created. Additional rows are added as entries are made.
新属性 | Enter the name of the new attribute. |
Attribute Value | New attributes can be left without a value for use elsewhere, or you can set new values here by clicking in the appropriate row and:
See定义值below for detailed information on using these options. |
Expanding the Advanced section provides access to the attributes of adjacent features that can be used to define values. While this section may appear complex, most users will rarely need this functionality.
Check “Enable Adjacent Feature Attributes” to use this feature.
You can now set an attribute value (in the Attribute Actions matrix) based on the attributes of features prior or subsequent to the current feature by referencing them as follows:
- Attributes of prior features are referenced as feature[-1].AttrName, feature[-2].AttrName, etc.
- 后续功能的属性被称为特征[+1] .attrname,功能[+2] .attrname等。
- Attributes of the currently processed feature are accessed directly without a prefix, such as AttrName.
When retrieving the value of a prior feature, any changes made by the AttributeCreator to that feature will take effect.
Number of Prior Features
This parameter specifies the maximum number of prior features that can be referenced by the AttributeCreator. If Multiple Feature Attribute Support is enabled, this must be a value from 0 to 100. As additional features must be read for each feature processed, defining only the maximum number of features needed to be retrieved will improve performance.
后续功能的数量
This parameter specifies the maximum number of subsequent features that can be referenced by the AttributeCreator. If Multiple Feature Attribute Support is enabled, this must be a value from 0 to 100. As additional features must be read for each feature processed, defining only the maximum number of features needed to be retrieved will improve performance.
替换丢失,无效,空
This parameter specifies the desired behavior when the referenced attribute does not exist, has a null value, or has an empty string value.
此类属性可以被认为是未解决的属性。例如,由于在第一个输入功能之前没有功能,因此attributecreator将无法解决第一个输入功能的特征[-1] .attrname的值。如果此参数设置为No Substitution, the AttributeCreator will resolve all unresolved attributes with an empty string.
As another example, if the value of feature[+2] is the empty string andDefault Valueis specified, then the empty string will be treated as an unresolved attribute, and will be resolved as the value specified under Default Value.
如果此参数设置为Closest Adjacent Feature,如果存在这样的功能,则未解决的属性将被解析为最近特征的相应属性。查找最近的功能时,跳过具有未解决属性的功能。
例如,如果特征[-2] .attrname的值未解析,则要解析功能的值[-2] .attrname该属性将查看最接近的功能[-2],在此之前在功能之间交替交替并在特征[-2]之后。它将首先查看特征[-3] .attrname,然后是特征[-1] .attrname,如果需要,然后在需要的情况下要包含[-4] .attrname,直到指定的所有先前和后续功能都已耗尽。
If the attribute remains unresolved within the specified prior and subsequent features, then it will be resolved as the value specified in the Default Value parameter.
Default Value
This parameter specifies the value used to resolve unresolved attributes in these cases:
- Substitute Missing, Null and Empty by: is set toDefault Value
- Substitute Missing, Null and Empty by: is set toClosest Adjacent Feature在指定的先前和后续功能的数量内找不到值。
Dialog Options
行重新排序 |
Enabled once you have clicked on a new attribute in the list. Choices include:
|
Filter |
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. |
Import |
The import button will populate the transformer with a set of new attributes read from a dataset. If the transformer already contains new attribute entries, these attributes will be appended to the existing list. |
定义值
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
const文本编辑器提供了一个方便的方法ruct 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
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
内容
Expressions and strings can include a number of functions, characters, parameters, and more - whether entered directly in a parameter or constructed using one of the editors.
These functions manipulate and format strings. | |
文本编辑器中提供了一组控制字符。 | |
两个编辑器都有数学函数。 | |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Working with User Parameters | 创建自己的可编辑参数。 |
参考
Processing Behavior |
Feature-Based |
Feature Holding |
No |
Dependencies | 没有任何 |
FME Licensing Level | FME基本版及以上 |
Aliases | |
History | |
Categories |
FME Knowledge Center
FME知识中心是演示,How-TOS,文章,常见问题和更多的地方。获取您的问题的答案,从其他用户学习,并建议,投票和评论新功能。
Search forall results about the AttributeCreatoron the FME Knowledge Center.