斯潘8
span4
FME 2018.0中的相关数据库表使用新的FeatureJoinertransformer.FeatureJoiner基于公共属性值组合功能的属性,类似于SQL联接操作。在本教程中,您将学习如何基于主键从两个数据库表中联接功能,但是可以修改此方法以组合来自多个数据类型的特征(例如,shapefile and database table).
注:既然你是使用面向公共的数据库,有时可以覆盖和/或修改表。If your translation produces unexpected results,见重置PostGIS培训数据库文章.或者,you can download the provided file(s) and replace the PostGIS reader with a reader of the appropriate format.
In this exercise,您将学习如何基于主键联接两个表。在这种情况下,您希望基于地址ID加入两个表,因为您希望拥有一个包含完整邮件地址的数据集。
注意:如果表名与现有表匹配,数据将被覆盖。
注意:点击读卡器上的箭头,您将公开已读入的属性列表。如果同时展开AddressPoints和Vanhomes Reader上的属性,您会注意到AddressPoints表使用的是标题库,而Vanhomes表使用的是小写。
您将执行内部联接,因此输入的位置(左和右)并不重要,因为输出将只包含匹配的特性;然而,if you were performing a left join (matched features and all unmatched left features) the position is important otherwise you will have an unexpected result.有关如何使用连接变压器的详细说明,见Working with Merging/Joining Transformers (How to choose the right one).
运行工作区后,您的数据库将有一个新表(public.joinedAddresses)和联接字段。You can view the new table by selecting the writer and clicking the Inspect button in the shortcut menu that appears when the writer is selected.
在练习2中,您将使用FeatureMerger向表中添加新列。Rather than creating a column and assigning values,you will be appending longitude and latitude data from another file into your database table.您将对数据库表和正在读取的csv文件(即内部连接)。
有关创建翻译的详细信息,见桌面基础课程手册.
Note: Drop and Create is used when the table needs to be emptied and an update is made to the database schema.例如,当您希望用新内容更新表并要求向表中添加新列时,将使用此选项。
Note: An Automatic Attribute Definition is when Workbench automatically defines the list of attributes,取决于连接的读卡器功能类型。此外,the list of attributes on the Writer feature type will update automatically whenever attributes are changed (i.e.更名,removed,etc.) in the workspace.有关用户属性和属性定义的详细信息,见Documentation.
To learn more about using Key-Based Transformers in FME,见桌面基础课程手册.
只有匹配的功能通过FeatureMerge,这将导致重复的行(即名称-从csv文件,以及postgis表中的名称)。
注意:您还可以使用转换器(如attributeManager)删除不需要的属性,属性移动器,或者将writer属性定义设置为manual并删除属性。For more information on managing/removing attributes,见桌面基础课程手册.
默认情况下,FME工作区参数设置为终止转换,如果功能合并拒绝任何功能,将导致工作区停止。You can learn more about rejected feature handling in the桌面基础课程手册.
运行翻译后,您的表将有纬度和经度列。通过选择写入程序功能类型并单击在选择写入程序时出现的快捷菜单中的“检查”按钮,可以查看新表。
本教程中使用的数据源于温哥华市,不列颠哥伦比亚省。它包含根据开放政府许可证(温哥华)获得许可的信息。
?2019安全亚搏在线软件公司|合法的