属性管理器
典型用途
- 创建新属性,并以各种方式为其设置默认值或新值
- Modify existing attributes by renaming,删除它们,并为它们设置或清除值
- 重新排序属性
- 根据当前功能之前或之后的功能设置属性值
- 通过将多个属性操作转换器合并到一个位置来简化工作区
How does it work?
输入特征的属性以行和列的矩阵表示,where you can perform multiple tasks.所有通过attributeManager的功能都会根据参数中的选择进行修改。
在这个例子中,修改输入功能的几个属性:
- GlobalID is renamed,更改属性名称的大小写。还重命名了几个地址属性。
- 创建一个新的属性“fullname”,concatenating the values of two other attributes
- Several unwanted attributes are removed
- 创建X和Y属性,并通过使用FME函数提取几何图形来指定值。
- "UPDATEDBY" is created and set to the fixed value "Smith".
- 所有其他属性都通过未接触的
The altered attributes are reflected in the transformer.
在“高级:属性值处理”下可以访问相邻的功能属性。When turned on,you can specify a number of features preceding and following the current feature to reference in calculating new values.
假设我们得到以下数据集:
ID |
Latitude |
Longitude |
---|---|---|
零 |
四十九点一六四零 |
-123.061 |
一 |
四十九点一六四三 |
-123.063 |
2 |
49.1642 |
-123.062 |
3 |
49.1642 |
-123.064 |
如果先前功能的数量and后续功能的数量parameters are both set to 2,然后当第一个特性被读取时,attributeManager可以访问以下功能:
功能参考 |
ID |
Latitude |
Longitude |
---|---|---|---|
特征〔2〕 |
|
|
|
feature[-1] |
|
|
|
current feature |
零 |
四十九点一六四零 |
-123.061 |
feature[+1] |
一 |
四十九点一六四三 |
-123.063 |
特征[+ 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,attributeManager可用的先前和后续功能窗口将切换以生成以下内容:
功能参考 |
ID |
Latitude |
Longitude |
---|---|---|---|
特征〔2〕 |
|
|
|
feature[-1] |
零 |
四十九点一六四零 |
-123.061 |
current feature |
一 |
四十九点一六四三 |
-123.063 |
feature[+1] |
2 |
49.1642 |
-123.062 |
特征[+ 2 ] |
3 |
49.1642 |
-123.064 |
This statement would calculate the average latitude of the two preceding features:
可以在算术编辑器和文本编辑器中创建引用相邻特征的计算。这些编辑器将首先列出当前处理的功能的属性,然后前面的特性,然后是后续功能。
Configuration
Input Ports
此转换器接受任何功能。
输出端口
Features with the created and modified attributes.
参数
当第一次连接和打开一个属性管理器变压器时,此矩阵将自动填充当前存在的传入功能的属性。It will also adjust dynamically to reflect upstream attribute changes in the workspace.
默认情况下,这些操作被设置为“不做任何事情”,并通过未更改的功能。当您对单个项目进行更改时,FME根据您的输入解释适当的操作。可以手动重写操作,但是你一般不需要调整它。
输入属性 | 当第一次打开变压器时,此列将填充发送到输入端口的公开属性的完整列表。此字段不可编辑,但将更新以反映在工作区中所做的更改。创建新属性时,此字段将保持空白。 |
输出属性 | 默认情况下,输出属性与输入属性匹配。你可以:
|
属性值 | 默认情况下,属性值为空,保持功能不变。You can set new values here by clicking in the appropriate row and:
见定义价值下面是关于使用这些选项的详细信息。 |
行动 | 默认情况下,Action is set to "Do Nothing",leaving features unchanged.As you make changes in the parameters,操作将自动调整以反映适当的结果,which can be manually overridden in some cases.可用操作包括: Set Value: Sets the attribute to the value specified in the Attribute Value column.覆盖现有属性值。 什么也不做:保持属性不变。 重命名:将输入属性重命名为输出属性列中指定的名称。 Remove:完全删除属性并将其从输出架构中删除。 Set Default Value:将属性的指定值指定给缺少属性的功能。Does not overwrite current values,包括NULL。 注:
|
Expanding the Advanced section provides access to the attributes of adjacent features that can be used to define values.虽然这一部分看起来很复杂,most users will rarely need this functionality.
选中“启用相邻功能属性”以使用此功能。
现在,您可以根据当前功能之前或之后的功能的属性(在属性操作矩阵中)通过以下引用来设置属性值:
- 先前功能的属性被引用为feature[-1].attrname,feature[-2].AttrName,等。
- 后续功能的属性被引用为功能[+1].attrname,feature[+2].AttrName,等。
- Attributes of the currently processed feature are accessed directly without a prefix,such as AttrName.
检索先前功能的值时,属性管理器对该功能所做的任何更改都将生效。
先前功能的数量
此参数指定attributeManager可以引用的先前功能的最大数量。如果启用了多功能属性支持,这必须是0到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 AttributeManager.如果启用了多功能属性支持,这必须是0到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.
替代品丢失,Null,and Empty by
当引用的属性不存在时,此参数指定所需的行为,有一个空值,或具有空字符串值。
这些属性可以被认为是未解决的属性。For example,由于在第一个输入功能之前没有任何功能,attributeManager将无法解析第一个输入功能的值[-1].attrname。
如果此参数设置为不替代,the AttributeManager will resolve all unresolved attributes with an empty string if they are used in a larger expression.If the unresolved attribute is assigned directly and is not part of a larger expression,然后输出属性将以同样的方式解析。For example,如果B不见了,A被设置为@Value(B),然后A也会丢失。但是如果A设置为“b= @值(b)”,A will have the value of"B = ".
作为另一个例子,如果特征值[+2]是空字符串并且默认值指定,then the empty string will be treated as an unresolved attribute,并将解析为默认值下指定的值。
如果此参数设置为Closest Adjacent Feature,然后将未解析的属性解析为最近特征的对应属性,如果存在这样的特征。在寻找最接近的功能时,跳过具有未解析属性的功能。如果之前或之后的功能具有未解析的属性,当前功能可能用于解决缺少的属性。
For example,如果功能的值[-2].attrname未解析,然后要解析feature[-2]的值。attrname attributeManager将查看最接近feature[-2]的功能,alternating between features prior to and subsequent to feature[-2].它将首先查看特性[-3]。属性名称,followed by feature[-1].AttrName if needed,然后特征号为[-4]。如果需要,请指定名称,直到指定的所有先前和后续功能都已用尽。
If the attribute remains unresolved within the specified prior and subsequent features,然后将其解析为默认值参数中指定的值。
默认值
This parameter specifies the value used to resolve unresolved attributes in these cases:
- 替代品丢失,Null and Empty by: is set to默认值
- 替代品丢失,Null and Empty by: is set toClosest Adjacent Feature在指定的前一个和后一个功能的数目内找不到值。
对话选项
行重新排序
|
Enabled once you have clicked on a row in the Attribute Actions matrix.Choices include:
|
滤波器
|
开始键入字符串,矩阵将只显示与这些字符匹配的行。搜索所有列。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 matrix with a 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 parameters can be assigned by referencing other elements in the workspace.更高级的功能,例如高级编辑器和算术编辑器,are also available in some transformers.要访问这些选项的菜单,点击在适用参数旁边。有关更多信息,seeTransformer Parameter Menu Options.
定义价值
定义用于变压器的值有几种方法。最简单的方法是简单地键入一个值或字符串,它可以包含各种类型的函数,例如属性引用,math and string functions,和工作区参数。有许多工具和快捷方式可以帮助构造值,通常可从值字段旁边的下拉上下文菜单中获得。
Using the Text Editor
文本编辑器提供了一种从各种数据源构造文本字符串(包括正则表达式)的方便方法,比如属性,参数,and constants,其中结果直接在参数内部使用。
使用算术编辑器
算术编辑器提供了一种从各种数据源构造数学表达式的方便方法,比如属性,参数,以及功能,其中结果直接在参数内部使用。
条件值
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
内容
表达式和字符串可以包含多个函数,字符,参数,and more - whether entered directly in a parameter or constructed using one of the editors.
参考文献
Processing Behavior |
基于特征 |
Feature Holding |
No |
依赖关系 | 没有 |
FME Licensing Level | FME Base Edition and above |
别名 | |
历史 | Released: FME 2016.0 |
类别 |
FME 亚搏国际在线官网Community
FME社区是演示亚搏国际在线官网的地方,如何,articles,常见问题解答,还有更多。回答你的问题,learn from other users,并建议,vote,以及对新功能的评论。
寻找关于属性管理器的所有结果关于FME社区。亚搏国际在线官网
示例可能包含根据开放式政府许可证(温哥华)获得许可的信息。