attributecreator.
典型的用途
- 将新属性添加到功能并将其分配一个值
- 将新的空属性添加到工作区其他位置使用的功能
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.
New attributes are added at the top. Duplicate names are not identified, and are not added more than once.
- 在此示例中,将三个新属性添加到输入功能中:
- UPDATEDBY is added and set to the constant value “Smith”.
- X and Y are added, and set to the feature’s coordinates by extracting geometry with an FME function.
The new attributes are reflected in the transformer, at the top of the attribute list.
属性值已更新,可以在数据检查器的表视图中查看。
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.
假设我们给出了以下数据集:
ID |
纬度 |
经度 |
---|---|---|
0. |
4.9.1640 |
-123.061 |
1 |
4.9.1643 |
-123.063 |
2 |
4.9.1642 |
-123.062 |
3. |
4.9.1642 |
-123.064. |
If the现有功能数量andNumber of Subsequent Features参数都设置为2,然后读取第一个功能时,attributecreator可以访问以下功能:
功能参考 |
ID |
纬度 |
经度 |
---|---|---|---|
特征[-2] |
|||
feature[-1] |
|||
current feature |
0. |
4.9.1640 |
-123.061 |
feature[+1] |
1 |
4.9.1643 |
-123.063 |
特征[+2] |
2 |
4.9.1642 |
-123.062 |
请注意,某些属性丢失,因为第一个功能之前没有存在功能。
读取第二个功能后,attributecreator可用的先前和后续功能的窗口以产生以下内容:
功能参考 |
ID |
纬度 |
经度 |
---|---|---|---|
特征[-2] |
|||
feature[-1] |
0. |
4.9.1640 |
-123.061 |
current feature |
1 |
4.9.1643 |
-123.063 |
feature[+1] |
2 |
4.9.1642 |
-123.062 |
特征[+2] |
3. |
4.9.1642 |
-123.064. |
此声明将计算前面前面的两个功能的平均纬度:
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
- Consider using theattributemanager.instead
配置
Input Ports
This transformer accepts any feature.
输出Ports
Features with the new attributes and optionally defined values.
参数
第一次打开attributecreator时,此区域将包含一个空的行,其中可以创建一个新属性。添加附加行作为参赛作品。
New Attribute | 输入新属性的名称。 |
Attribute Value | 可以在没有其他地方使用的值,或者您可以通过单击相应的行和:
看Defining Values下面有关使用这些选项的详细信息。 |
扩展高级部分提供对可用于定义值的相邻功能的属性的访问。虽然此部分可能会出现复杂,但大多数用户很少需要此功能。
检查“启用相邻的功能属性”以使用此功能。
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:
- 先前功能的属性称为特征[-1] .attrname,功能[-2] .attrname等。
- Attributes of subsequent features are referenced as feature[+1].AttrName, feature[+2].AttrName, etc.
- 当前处理的功能的属性直接访问,没有前缀,例如attrname。
检索先前功能的值时,attributecreator对该功能的任何更改都将生效。
现有功能数量
此参数指定attributecreator可以引用的最大现有功能数。如果启用了多个功能属性支持,则这必须是0到100的值。由于必须为处理的每个要素读取其他功能,仅定义要检索所需的最大功能数将提高性能。
Number of Subsequent Features
这个爸爸rameter 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.
Substitute Missing, Null, and Empty by
此参数指定当引用的属性不存在时的所需行为,具有空值,或具有空字符串值。
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 feature[-1].AttrName for the first input feature. If this parameter is set toNo Substitution,attributecreator将使用空字符串解析所有未解决的属性。
作为另一个例子,如果特征[+2]的值是空字符串和默认值指定,那么空字符串将被视为未解析的属性,并且将被解析为默认值下指定的值。
If this parameter is set toClosest Adjacent Feature,如果存在这样的功能,则未解决的属性将被解析为最近特征的相应属性。查找最近的功能时,跳过具有未解决属性的功能。如果先前或后续功能具有未解决的属性,则可能使用当前功能来解决缺失属性。
For example, if the value of feature[-2].AttrName is unresolved, then to resolve the value of feature[-2].AttrName the AttributeCreator will look at the closest features to feature[-2], alternating between features prior to and subsequent to feature[-2]. It will first look at feature[-3].AttrName, followed by feature[-1].AttrName if needed, and then feature[-4].AttrName if needed, until all prior and subsequent features specified have been exhausted.
如果属性在spe仍未得到解决cified prior and subsequent features, then it will be resolved as the value specified in the Default Value parameter.
默认值
此参数指定用于在这些情况下解析未解析属性的值:
- 替换丢失,null和空的:设置为默认值
- 替换丢失,null和空的:设置为Closest Adjacent Featureand a value is not found in within the number of prior and subsequent features specified.
对话框选项
Row Reordering |
Enabled once you have clicked on a new attribute in the list. Choices include:
|
筛选 |
开始键入字符串,矩阵仅显示匹配这些字符的行。搜索所有列。这仅影响变换器内的属性的显示 - 它不会更改输出哪个属性。 |
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. |
编辑变换器参数
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变换器参数菜单选项。
Defining Values
有几种方法可以在变压器中定义使用的值。最简单的是简单地输入值或字符串,其可以包括各种类型的函数,例如属性引用,数学和字符串函数和工作区参数。有许多工具和快捷方式可以帮助构造值的值,通常可以从与值字段相邻的下拉上下文菜单中提供。
使用文本编辑器
文本编辑器提供了一种方便的方法来构建来自各种数据源的文本字符串(包括正则表达式),例如属性,参数和常量,其中结果直接在参数内使用。
使用算术编辑器
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.
条件值
根据通过或失败的一个或多个测试条件设置值。
Content
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.
Reference
处理行为 |
特征为基础 |
功能持有 |
No |
依赖性 | None |
FME许可级别 | FME Base Edition and above |
别名 | |
历史 | |
类别 |
FME知识中心
The FME Knowledge Center is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
搜索所有结果关于attributecreatoron the FME Knowledge Center.