AttributeManager
典型的用途
- Create a new attribute, and set default or new values for it in a variety of ways
- Modify existing attributes by renaming, and deleting them, and set or clear values for them
- 重新订购属性
- 根据当前功能之前或之后的功能设置属性值
- 通过将多个属性操纵变压器巩固到一个地方来简化工作空间
它是如何工作的?
Attributes of the input features are presented in a matrix of rows and columns, where you can perform multiple tasks. All features that pass through the AttributeManager are modified according to the selections made in the parameters.
在此示例中,修改了几个输入功能的属性:
- GlobalId更名为,更改属性名称的情况。还重命名了几个地址属性。
- A new attribute “FULLNAME” is created, concatenating the values of two other attributes
- Several unwanted attributes are removed
- X and Y attributes are created and values are assigned by extracting geometry with an FME function
- 创建并设置为“更新”并将其设置为“史密斯”。
- 所有其他属性通过未触及的
The altered attributes are reflected in the transformer.
在Advanced:属性值处理下访问相邻的功能属性。打开时,您可以指定在当前功能之前的多个功能,以便在计算新值时参考。
Suppose we are given the dataset below:
ID |
纬度 |
经度 |
---|---|---|
0 |
49.1640 |
-123.061 |
1 |
49.1643 |
-123.063 |
2 |
49.1642 |
-123.062 |
3 |
49.1642 |
-123.064 |
如果是Number of Prior Features和Number of Subsequent Features参数均设置为2,然后读取第一个功能时,AttributeManager可以访问以下功能:
功能参考 |
ID |
纬度 |
经度 |
---|---|---|---|
feature[-2] |
|||
特征[-1] |
|||
current feature |
0 |
49.1640 |
-123.061 |
特征[+1] |
1 |
49.1643 |
-123.063 |
feature[+2] |
2 |
49.1642 |
-123.062 |
不te that some attributes are missing because no features exist prior to the first feature.
读取第二个功能后,可用于AttributeManager可用的先前和后续功能的窗口以产生以下内容:
功能参考 |
ID |
纬度 |
经度 |
---|---|---|---|
feature[-2] |
|||
特征[-1] |
0 |
49.1640 |
-123.061 |
current feature |
1 |
49.1643 |
-123.063 |
特征[+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:
可以在算术编辑器和文本编辑器中创建引用引用相邻功能的计算。这些编辑器将首先列出当前处理的功能的属性,然后是先前的功能,然后是后续功能。
配置
Input Ports
This transformer accepts any feature.
输出端口
Features with the created and modified attributes.
Parameters
When an AttributeManager transformer is connected and opened for the first time, this matrix is automatically populated with the incoming features’ attributes as they currently exist. It will also adjust dynamically to reflect upstream attribute changes in the workspace.
默认情况下,操作将设置为“do nothing”并通过未置换的功能。当您对单个项目进行更改时,FME根据输入解释适当的措施。可以手动覆盖动作,但您一般不应需要调整它。
Input Attribute | When the transformer is first opened this column is populated with the full list of exposed attributes sent to the input port. This field is not editable, but will update to reflect changes made in the workspace. When new attributes are created this field will remain blank. |
输出属性 | 默认情况下,输出属性匹配输入属性。你可以:
|
属性值 | By default, Attribute Value is blank, leaving the features unchanged. You can set new values here by clicking in the appropriate row and:
SeeDefining Valuesbelow for detailed information on using these options. |
Action | 默认情况下,操作设置为“do noth”,留下功能不变。在参数中进行更改时,操作将自动调整以反映适当的结果,在某些情况下可以手动覆盖。可用的行动是: 设定值: Sets the attribute to the value specified in the Attribute Value column. Overwrites existing attribute values. 没做什么:留下属性未置换。 Rename: Renames the input attribute to the name specified in the Output Attribute column. 去掉: Deletes the attribute entirely and removes it from the output schema. 设置默认值:将属性的指定值分配给缺少属性的特征。不会覆盖当前值,包括null。 NOTE:
|
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.
您现在可以根据当前功能的特征属性或在当前特征中引用它们如下所示,设置属性值(在属性操作矩阵中):
- 先前功能的属性称为特征[-1] .attrname,功能[-2] .attrname等。
- Attributes of subsequent features are referenced as feature[+1].AttrName, feature[+2].AttrName, etc.
- 当前处理的功能的属性直接访问,没有前缀,例如attrname。
When retrieving the value of a prior feature, any changes made by the AttributeManager 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 AttributeManager. 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.
Number of Subsequent Features
此参数指定可以由AttributManager引用的后续功能的最大数量。如果启用了多个功能属性支持,则这必须是0到100的值。由于必须为处理的每个要素读取其他功能,仅定义要检索所需的最大功能数将提高性能。
Substitute Missing, Null, and Empty by
This parameter specifies the desired behavior when the referenced 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 AttributeManager will fail to resolve the value of feature[-1].AttrName for the first input feature. If this parameter is set to没有替代, the AttributeManager will resolve all unresolved attributes with an empty string.
As another example, if the value of feature[+2] is the empty string and默认值is specified, then the empty string will be treated as an unresolved attribute, and will be resolved as the value specified under Default Value.
如果此参数设置为最近的相邻特征, then the unresolved attributes 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. If a prior or subsequent feature has unresolved attributes, it is possible that the current feature is used to resolve the missing attributes.
For example, if the value of feature[-2].AttrName is unresolved, then to resolve the value of feature[-2].AttrName the AttributeManager 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.
如果该属性在指定的先前和后续功能中仍未解决,则它将被解析为默认值参数中指定的值。
默认值
此参数指定用于在这些情况下解析未解析属性的值:
- Substitute Missing, Null and Empty by: is set to默认值
- Substitute Missing, Null and Empty by: is set to最近的相邻特征和a value is not found in within the number of prior and subsequent features specified.
对话框选项
Row Reordering |
在属性操作矩阵中单击一行后启用。选择包括:
|
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按钮将填充矩阵set of Output Attributes read from a dataset. If the transformer already contains a schema, these attributes will be appended to the existing list. |
刷新 |
刷新会将矩阵内容重置为其默认状态,丢弃所做的更改并将所有操作重置为“不做”。 |
编辑变换器参数
使用一组菜单选项,可以通过引用工作区中的其他元素来分配变压器参数。一些变压器也可提供更高级的功能,例如高级编辑器和算术编辑器。要访问这些选项的菜单,请单击除适用的参数旁边。有关更多信息,请参阅Transformer Parameter Menu Options.
Defining Values
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
文本编辑器提供了一种方便的方法来构建来自各种数据源的文本字符串(包括正则表达式),例如属性,参数和常量,其中结果直接在参数内使用。
使用算术编辑器
算术编辑器提供了一种方便的方法来构建来自各种数据源的数学表达式,例如属性,参数和特征函数,其中结果直接在参数内使用。
条件值
根据通过或失败的一个或多个测试条件设置值。
Parameter Condition Definition Dialog
Content
表达式和字符串可以包括许多函数,字符,参数等 - 是否直接在参数中输入或使用其中一个编辑器构造。
These functions manipulate and format strings. | |
A set of control characters is available in the Text Editor. | |
Math functions are available in both editors. | |
这些运算符可在算术编辑器中使用。 | |
这些主要是特定于特征的值。 | |
可以使用FME和工作区的参数。 | |
Working with User Parameters | Create your own editable parameters. |
Reference
Processing Behavior |
Feature-Based |
Feature Holding |
不 |
依赖性 | 不ne |
FME Licensing Level | FME Base Edition and above |
别名 | |
历史 | 发布:FME 2016.0 |
类别 |
FME Knowledge Center
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.
搜索所有结果关于attributemanager在FME知识中心。