span8
span4
span8
span4
Welcome to the FME for Smallworld 5 tutorial. This article describes how to work with Smallworld 5 join fields in FME. FME can read different types of join fields. FME can also read intermediate join tables, for example,electricity.int!supply_point_customer。So when exporting from Smallworld you can reconstruct more complex joins.
Some fields are not always made visible in the Smallworld GIS, and they must be visible for FME to be able to read the fields. Join fields are very often not visible. Use the Smallworld ACE application to make the fields you need to access visible to FME.
The FME Smallworld 5 writer can import join fields for text-based joins fields and foreign key fields. Other types of join fields are not supported, refer to the GE Smallworld documentation: theSmallworld FME Translator Documentation- Translating fields of Smallworld RWOs - Join Fields (you need to obtain the login from GE SupportCentral). You may have to make some fields visible using the Administration ACE application so that the FME writer can access them.
FME can load simple joins. There are three types of joins that can be represented:
您将使用FME数据检查,查看更加复杂的连接表。让我们看看下面的表及其相关的连接表:
上面的图片来自于Smallworld的情况下的电力网络。没有为客户和供应点连接表。
1) FME Data Inspector
Start FME Data
Select File > Open Dataset.
Enter the reader format parameters
Reader Format: | Smallworld的4/5 |
Coordinate System: | OSGB-GPS-2015 |
2)输入数据库连接参数
Click on the Parameters button and enter the Smallworld database connection parameters:
Server Host: | 本地主机 |
Server Port: | 30000 |
Service: | FMENOFACTORY |
Username: | (blank) |
Password: | (blank) |
3) Select Constraints
Still in the Parameters dialog, check Expose Internal Tables.
Click on the Table List browse button.
Select each of these feature types:
The int! objects are the intermediate join tables.
点击确定关闭选择功能类型对话框。
Uncheck Use Search Envelope.
4) Inspect Results
In the Data Inspector Table View, you should see all of the selected objects. Theelectricity.int!supply_point_customeris the join table for Customers & Supply Points.
您可以使用相同的步骤在工作台来创建一个工作区,读取和保留客户之间的关系和供应点通过INT对象!表加载到,比方说,一个ESRI的地理数据库关系要素类。
In this example, you’ll load some new features for Company and Office and build the relationship. This is a 1:n relationship with Company as the parent and Office as the child table.
As mentioned above, to export join fields, you may have to make the fields visible in the Administration ACE application. In the following example, the Company object has had the ‘id’ field made visible and the Office object has had the office_id and company_id fields made visible. These fields are not exposed in the default Cambridge database.
要做到这一点的Smallworld:你会使用管理应用程序打开“ACE配置”工具。使用编辑 - 对象属性菜单来更改相应的属性,包括外地的知名度。
首先,我们将添加一个新的公司记录到的Smallworld数据库:
1) Open Workspace
Start FME Workbench and open the workspace:smallworld9a-complete.fmwt。工作区从MapInfo的MIF文件读取公司信息和写入到办公室对象“| fme_offices”替代。
2)执行命令的工作区
运行工作区。这将增加一个新的记录到的公司目标| fme_offices替代。
还有就是公司对象没有几何,所以检查的Smallworld的资源管理器的结果(在工具菜单 - >浏览器...)。导航地理信息系统>非拓扑对象>公司并浏览所有功能 - 不要忘记切换到GIS版本| fme_offices
你可以看到有没有联系到“安全软件公司”的办公室亚搏在线公司。
3)打开工作区
打开这个练习的第二工作区:smallworld9b-complete.fmwt
这是一个更有趣一点。此工作区增加了一个新的Office纪录,使连接到公司的对象。
为了使办公室和公司之间的连接,您必须将公司的主键添加到Office对象 - 为外键。在Office表的外键是“COMPANY_ID”必须对本公司的表是“ID”的主键相匹配。
在工作区中:
在书签“办公地点/注解几何”变压器创建了位置和注释的几何形状的Office功能,以同样的方式与以前的练习。
Smallworld 5 reader: This workspace uses the Smallworld reader to read back the Company records. You could also add a predicate to the reader to limit which Company records are read back.
FeatureMerger:加入Office对象的相关公司。我们可以使用公司名称的加入。Office对象现在有哪些可以作为外键的公司ID“。
AttributeCreator: Rename the ‘id’ field (which is the Company primary key) to ‘company_id’ which is the foreign key on the Office child object.
4) Run Workspace
运行工作区。这将增加一个新的记录到在办公室桌子| fme_offices替代
Check the results in the Smallworld Explorer – don’t forget to switch to the GIS version |fme_offices.
对于公司的表,你应该看到原来的安全软件公司的公司,但它现在应该显示相关的办事处数量:亚搏在线
正如前面提到的,您可能需要使用管理工具ACE,使一些参加可见字段。
总之,建立一个简单的联结关系,你需要设置外键的子表,以匹配父表的主键。
© 2020 Safe Software Inc |Legal