AttributeCreator
典型用途
- 向要素添加新属性并为其指定值
- 向功能添加新的空属性,以便在工作区的其他位置使用
它是如何工作的?
Blank rows are provided where you can enter new attribute names and (optionally) set values for them.可以添加一个或多个新属性,所有通过变压器的特性都会根据这些选择进行修改。
New attributes are added at the top.没有识别出重复的名称,and are not added more than once.
- In this example,输入功能中添加了三个新属性:
- UPDATEDBY is added and set to the constant value "Smith".
- 加上x和y,and set to the feature's coordinates by extracting geometry with an FME function.
新属性反映在变压器中,在属性列表的顶部。
更新属性值,and can be viewed in the Data Inspector's table view.
在“高级:属性值处理”下可以访问相邻的功能属性。打开时,在计算新值时,可以指定当前特征前面和后面要引用的许多特征。
Suppose we are given the dataset below:
身份证件 |
纬度 |
经度 |
---|---|---|
零 |
四十九点一六四零 |
-123.061 |
1 |
49.1643 |
-123.063 |
二 |
四十九点一六四二 |
-123.062 |
三 |
四十九点一六四二 |
-123.064 |
If theNumber of Prior Features和后续功能的数量参数均设置为2,then when the first feature is read,attributeCreator可以访问以下功能:
功能参考 |
身份证件 |
纬度 |
经度 |
---|---|---|---|
特征〔2〕 |
|
|
|
特征〔1〕 |
|
|
|
当前特征 |
零 |
四十九点一六四零 |
-123.061 |
特征[+ 1 ] |
1 |
49.1643 |
-123.063 |
特征[+ 2 ] |
二 |
四十九点一六四二 |
-123.062 |
请注意,某些属性丢失,因为在第一个功能之前不存在任何功能。
读取第二个功能后,the window of prior and subsequent features available to the AttributeCreator shifts to produce the following:
功能参考 |
身份证件 |
纬度 |
经度 |
---|---|---|---|
特征〔2〕 |
|
|
|
特征〔1〕 |
零 |
四十九点一六四零 |
-123.061 |
当前特征 |
1 |
49.1643 |
-123.063 |
特征[+ 1 ] |
二 |
四十九点一六四二 |
-123.062 |
特征[+ 2 ] |
三 |
四十九点一六四二 |
-123.064 |
此语句将计算前面两个功能的平均纬度:
可以在算术编辑器和文本编辑器中创建引用相邻特征的计算。These editors will list the attributes of the currently processed feature first,then the prior features,然后是后续功能。
使用说明
- Consider using the属性管理器instead
配置
输入端口
This transformer accepts any feature.
输出端口
具有新属性和可选定义值的功能。
Parameters
When an AttributeCreator is opened for the first time,此区域将包含一个空白行,可以在其中创建新属性。Additional rows are added as entries are made.
新属性 | 输入新属性的名称。 |
Attribute Value | 新属性可以不带任何值留在其他地方使用,或者,您可以单击相应的行并在此处设置新值:
See定义价值below for detailed information on using these options. |
展开“高级”部分可以访问可用于定义值的相邻功能的属性。虽然这一部分看起来很复杂,大多数用户很少需要这种功能。
选中“启用相邻功能属性”以使用此功能。
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,功能[-2].属性名称,等。
- 后续功能的属性被引用为功能[+1].attrname,特性[+2].属性名称,等。
- 当前处理的功能的属性直接访问,不带前缀,比如Attname。
When retrieving the value of a prior feature,any changes made by the AttributeCreator to that feature will take effect.
Number of Prior Features
此参数指定attributeCreator可以引用的先前功能的最大数量。如果启用了多功能属性支持,this must be a value from 0 to 100.由于必须为每个已处理的功能读取附加功能,仅定义需要检索的最大功能数将提高性能。
后续功能的数量
This parameter specifies the maximum number of subsequent features that can be referenced by the AttributeCreator.如果启用了多功能属性支持,this must be a value from 0 to 100.由于必须为每个已处理的功能读取附加功能,仅定义需要检索的最大功能数将提高性能。
Substitute Missing,无效的,空了
当引用的属性不存在时,此参数指定所需的行为,有一个空值,or has an empty string value.
Such attributes can be thought of as unresolved attributes.例如,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,则attributeCreator将使用空字符串解析所有未解析的属性。如果未解析的属性是直接分配的,并且不是更大表达式的一部分,然后,新属性将以相同的方式进行解析。例如,if B is missing,and A is set to值(b),then A will be missing as well.But if A is set to"B = @Value(B)",A的价值是“B=”.
As another example,if the value of feature[+2] is the empty string andDefault Valueis specified,然后,空字符串将被视为未解析的属性,and will be resolved as the value specified under Default Value.
If this parameter is set to最近的相邻特征,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,跳过具有未解析属性的功能。如果之前或之后的功能具有未解析的属性,it is possible that the current feature is used to resolve the missing attributes.
例如,如果feature[-2].attrname的值未解析,然后要解析feature[-2]的值。attrname attributeCreator将查看最接近feature[-2]的功能,在功能之前和之后的功能之间交替使用[-2]。It will first look at feature[-3].AttrName,后面跟着功能[-1]。如果需要,请输入名称,然后特征号为[-4]。如果需要,请指定名称,直到指定的所有先前和后续功能都已用尽。
如果该属性在指定的先前和后续功能中未解析,then it will be resolved as the value specified in the Default Value parameter.
Default Value
此参数指定在这些情况下用于解析未解析属性的值:
- Substitute Missing,空:设置为Default Value
- Substitute Missing,空:设置为最近的相邻特征在指定的前一个和后一个功能的数目内找不到值。
对话选项
Row Reordering
|
Enabled once you have clicked on a new attribute in the list.选择包括:
|
Filter
|
Start typing a string,and the matrix will only display rows matching those characters.Searches all columns.这只影响转换器内属性的显示-它不会改变输出的属性。 |
进口
|
The import button will populate the transformer with a set of new attributes read from a dataset.如果转换器已经包含新的属性项,这些属性将附加到现有列表中。 |
编辑变压器参数
Using a set of menu options,可以通过引用工作区中的其他元素来指定变压器参数。More advanced functions,such as an advanced editor and an arithmetic editor,也可用于一些变压器。To access a menu of these options,clickbeside the applicable parameter.更多信息,看见变压器参数菜单选项.
定义价值
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,数学和字符串函数,和工作区参数。有许多工具和快捷方式可以帮助构造值,generally available from the drop-down context menu adjacent to the value field.
使用文本编辑器
文本编辑器提供了从各种数据源构造文本字符串(包括正则表达式)的方便方法,such as attributes,parameters,常数,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
根据通过或失败的一个或多个测试条件设置值。
Content
Expressions and strings can include a number of functions,characters,parameters,以及更多——无论是直接输入参数还是使用其中一个编辑器构造。
这些函数操作和格式化字符串。 | |
A set of control characters is available in the Text Editor. | |
Math functions are available in both editors. | |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
可使用特定于FME和工作区的参数。 | |
使用用户参数 | 创建自己的可编辑参数。 |
Reference
处理行为 |
Feature-Based |
特征保持 |
不 |
依赖关系 | 没有 |
FME许可级别 | FME基础版及以上 |
Aliases | |
History | |
类别 |
FME社亚搏国际在线官网区
FME社区是演示亚搏国际在线官网的地方,how-tos,文章,FAQs,还有更多。Get answers to your questions,向其他用户学习,and suggest,投票表决,and comment on new features.
寻找all results about the AttributeCreatoron the FME 亚搏国际在线官网Community.
Examples may contain information licensed under the Open Government Licence – Vancouver