span8
span4
正如提到的前面的文章, any Reader dataset – in any format – can be used as the source for the outgoing schema. The key thing to remember is that the dynamic writer needs to be able to find that schema definition, by name, for this workflow to work.
所以,当你使用一个全新的名字写出来你的数据会发生什么?
In this situation, you need to use a special parameter inside the writer's feature type called 'Schema Definition Name'. This parameter informs the writer of the correct name to use when searching the source for a matching schema.
Here are a few reasons why you may encounter this:
在下面的例子中,一期工程已设置,以提供更新的城市模式在数据库的形式。这个数据库已经被预先确定,但包含通用功能类型名称。为了创造一个充满活力的工作流程,并写出与该数据库架构中的数亚搏在线据,数据库必须被添加到该工作区,工作区的资源。然后,我们将改变输出数据集的名称,包括城市作为前缀(即Vancouver_BusStops)。
包含我们的模式中的SpatiaLite数据库:
1。Add the Source Dataset
打开FME到一个新的工作区,并从读者菜单中选择“添加读者”。
2.添加数据集目标
从作家菜单中选择“添加作家”。
3.添加数据库作为一个资源
将数据库装载到使用此功能的设置作为读者资源:
Once the database is added, an entry is placed in the Navigator window:
4.创建新表名属性
我们将串联与该城市名称的现有特征的类型名称:“温哥华”。要做到这一点添加一个StringCocatenator并填写详细信息如下:
5.模式映射
确保工作区包含正确的映射,以匹配数据库中包含的新属性架构。在该例子中,变压器AttributeManager用于提供此。使用下表来创建属性映射。在AttributeManager连接到StringCocatenator,然后AttributeManager输出端口连接到动态作家。
输入属性 | 输出属性 |
PRIMARYINDEX | PID |
类 | ROAD_CLASS |
FEATUREID | FEATUREID |
numberOfLanes | ROAD_LANES |
routeNumber | ROUTE_NUM |
routeType | ROUTE_TYPE |
类型 | ROAD_TYPE |
名称 | PARK_NAME |
name_alt | NAME_ALT |
STOPABBR | STOP_ABBR |
STOPNAME | STOP_NAME |
6.设置在作家要素类型的架构定义
开放的动态类型并设置t作家特性able name to your attribute containing your new names. In the image below, the SpatiaLite database has been entered as the 'Schema Source'. Use the original fme_feature_type attribute for the 'Schema Definition Name' setting so that the Writer can find the table names inside the SpatiaLite database (If you don't do this, the writer will look for your concatenated name in the database and be unable to find the correct feature types):
7.运行工作区
运行,然后检查输出数据集具有正确的模式。
Final Thoughts
At this stage, any future updates can be added to this workflow without changing the existing workspace layout. As well, changes can be made to the database schema outside of the FME environment and the workspace can handle the new schema automatically.
注:在上面的例子中,如果数据库模式的确发生了变化,用户将需要更正AttributeManager变压器提供正确的属性映射。然而,在这种情况下使用的SchemaMapper变压器将提供一个外部的方法来处理任何映射问题,使得工作空间变化是不必要的。对于复杂的工作流程,这是亚搏在线为了减轻日后的维护问题,一个完美的方式。这被进一步讨论在Advanced Technique - Using the SchemaMapper。
完整的SchemaMapper教程可以在这里找到:SchemaMapper Transformer Tutorial
©2019安全亚搏在线软件公司|法律