AttributeCreator
Adds a number of attributes to the feature, supplying them with constants, attribute values, and expressions. Any feature that enters the transformer emerges with a new set of attributes as defined in the transformer’s parameters dialog.
输入端口
此变形器接受任何功能。
输出端口
具有创建属性的功能。
参数
Enabling this setting allows the user to set an attribute value based on the attributes of features prior or subsequent to the current feature. Attributes of prior features are referenced as特征[-1] .attrname那特征[-2] .attrname,等于后续功能的属性称为特征[+1] .attrname那特征[+2] .attrname等等。当前处理的功能的属性直接访问,而无需前缀,例如attrname.。
检索先前功能的值时,attributecreator对该功能的任何更改都将生效。
This parameter specifies the maximum number of prior features that can be referenced by the AttributeCreator. IfMultiple Feature Attribute Support已启用,这必须是0到100的值。
此参数指定可由attributecreator引用的后续功能的最大数量。如果Multiple Feature Attribute Support已启用,这必须是0到100的值。
This parameter specifies the desired behavior when the specified attribute does not exist, has a null value, or has an empty string value. Such attributes can be thought of as unresolved attributes. For example, since there are no features prior to the first input feature, the AttributeCreator will fail to resolve the value of特征[-1] .attrname对于第一个输入功能。如果此参数设置为使用空字符串那the AttributeCreator will resolve all unresolved attributes with an empty string. As another example, if the value of功能[2] .attrname是空字符串和使用其他价值指定了,然后将空字符串视为未解析的属性,并且将被解析为指定的值属性替换值。
如果此参数设置为Use Attribute Value of Closest Feature,那么attribu尚未解决tes will be resolved as the corresponding attribute of the closest feature, if such a feature exists. When looking for closest features, features with unresolved attributes are skipped. For example, if the value of特征[-2] .attrname未解决,然后解决价值特征[-2] .attrnamethe AttributeCreator will look at the closest features to特征[-2],在之前和之后的特征之间交替特征[-2]。它将首先看feature[-3].AttrName, 其次是特征[-1] .attrname如果需要,然后特征[-4] .attrname如果需要,直到指定的所有先前和后续特征都已耗尽。如果该属性在指定的先前和后续功能中仍未解决,则它将被解析为指定的值属性替换值参数。
This parameter specifies the value used to resolve unresolved attributes when the如果缺少属性值,null或空参数设置为Use Attribute Value of Closest Feature(但没有找到最近的值)或使用其他价值。
- Attribute Name: Enter a new attribute name in each Attribute Name field. The name entered can be an existing attribute, a constant, a user parameter or an expression. If a user parameter or expression is used, then the attribute name will be the value as computed at runtime.
- 值:输入与属性名称关联的值。
例
具有创建属性的功能。
In Workbench, the new attributes are added to the transformer:
如果您输出到Inspector,则表查看属性和值会出现:
假设我们给出了以下数据集:
ID | Latitude | Longitude |
---|---|---|
0. |
49.1640 |
-123.061 |
1 |
49.1643 |
-123.063 |
2 |
49.1642 |
-123.062 |
3. |
49.1642 |
-123.064 |
如果是现有功能数量and后续功能的数量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 |
---|---|---|---|
特征[-2] |
<缺失> |
<缺失> |
<缺失> |
特征[-1] |
<缺失> |
<缺失> |
<缺失> |
目前的功能 |
0. |
49.1640 |
-123.061 |
特征[+1] |
1 |
49.1643 |
-123.063 |
特征[+2] |
2 |
49.1642 |
-123.062 |
请注意,某些属性丢失,因为第一个功能之前没有存在功能。
读取第二个功能后,attributecreator可用的先前和后续功能的窗口以产生以下内容:
Feature Reference | ID | Latitude | Longitude |
---|---|---|---|
特征[-2] |
<缺失> |
<缺失> |
<缺失> |
特征[-1] |
0. |
49.1640 |
-123.061 |
目前的功能 |
1 |
49.1643 |
-123.063 |
特征[+1] |
2 |
49.1642 |
-123.062 |
特征[+2] |
3. |
49.1642 |
-123.064 |
The following settings can be used to compute the average latitude and longitude of the two features prior to the currently processed feature:
When using multi feature mode, the Advanced Editor sorts the attributes for the current feature above the attributes of prior and subsequent features.
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, see变压器参数菜单选项。
Transformer Categories
搜索FME知识中心
搜索有关此变压器的样本和信息FME知识中心。
标签关键词:attributesetter nullattributecrecer