FME功能建设

To construct an FME feature, a mapping rule, sayR.0.,它在下面定义避署ment must be activated. The feature is considered to be completely constructed whenR.0.去激活(参见标题的部分映射规则状态(激活,执行,暂停和解除激活)对于XFMAP映射规则的可能状态)。

我们将使用以下输入XML文档,P.oints1.xml图表说明如何从XFMAP文档中映射规则,features.xmp, directs the XML Reader to construct FME features.

P.oints1.xml

    0.324 0.233 0.596      0.874 0.948 0.554    

上述XML文档包含两个避署ments for which we want FME features to map into. To do this, we must define a feature mapping rule under the避署ment that activates when a读取元素启动标记。

笔记:R.ecall that a mapping rule R, from an active-search-set, is activated when the XML Reader reads the start-tag of an element E, in the input XML document stream, when R matches E.

以下XFMAP文档,特征.xmp,包含一个特征映射规则R.P.,定义在元素,与a匹配元素。

features.xmp

<?XML版本=“1.0”?> <!doctype xfmap系统“xfmap.dtd”>   <! - 调用此映射规则RP  - > <映射匹配=“point”>   

当上面的XML(P.oints1.xml) and xfMap (features.xmp) documents are fed into the XML Reader two FME features are constructed. The following is a FME log for the constructed features:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: '
属性:xml_type'具有值xml_no_geom'
几何类型:未知(0)
=============================================================.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: '
属性:xml_type'具有值xml_no_geom'
几何类型:未知(0)
=============================================================.

这是会发生什么:

功能搜索设置内容(步骤后)

映射规则的状态R.P.(课后)

1。

这feature-search-set is initialized:

没有激活功能映射规则,因此<feature-map>元素包含在功能搜索集中。

{R.P.}

de-activated

2。

XML阅读器读取<<P.oints>避署ment:

No mapping rules in the feature-search-set matches the <P.oints>元素。没有激活映射规则。读者继续读取<P.oints>元素。

{R.P.}

de-activated

3.

这XML Reader reads the start-tag a <P.oint>避署ment:

这mapping rulerp.in the feature-search-set matches the元素。rp.is activated.rp.也在执行状态,因为元素是目前上下文元素。

Sincerp.是在的避署ment,rp.指导XML阅读器开始构建新的FME功能。

既然要激活特征映射规则,则修改特征搜索集以包含来自的映射规则元素。(Thefeatures.xmpXFMAP文件没有元素,特征搜索集然后成为空集)。

{}

激活,执行

4。

这XML Reader reads the start-tag of a<颜色>元素。No mapping rules in the feature-search-set match the<颜色>元素(功能搜索集是空的)。

{}

激活,暂停

5。

这XML Reader reads the start-tag of a<red>元素。同样,没有激活映射规则。

{}

激活,暂停

6。

<red>避署ment is end-tag is read. The<red>避署ment did not cause the activation of any mapping rules, therefore no mapping rules are de-activated.

{}

激活,暂停

7。

5)和6)重复<green>and元素。

{}

激活,暂停

8。

<颜色>读取元素结束标记。这<颜色>避署ment did not cause the activation of any mapping rules, therefore no mapping rules are de-activated.

{}

激活,执行

9。

这XML Reader the start-tag of the<location>元素。No feature mapping rules are activated (the feature-search-map is empty).

{}

激活,暂停

10..

读取元素结束标记。这ocation>元素没有导致任何映射规则的激活,因此不激活映射规则。

{}

激活,执行

11.

<P.oint>读取元素结束标记。

R.P.已被激活(见映射规则状态section). The XML Reader considers the FME feature under construction to be complete whenR.P.de-activates.

这re are now no feature mapping rules activated so the feature-search-set now contains all the mapping rules that defined in the<feature-map>避署ment (i.e,R.P.).

{R.P.}

de-activated

12.

步s 3) through 11) are repeated for the second<P.oint>避署ment of the input stream. A blank FME feature is again output by the XML Reader.

......

......

13。

<P.oints>读取元素结束标记。XML读取器已完成读取输入XML文档。

{}

de-activated

FME features constructed by the XML Reader always carry anxml_type属性。此属性始终初始化为xml_no_geom. Until now, the XML Reader has only constructed blank features: for the reader to construct other parts of an FME feature, afeature mapping rule应该包含以下元素:

  1. 功能类型元素:is an optional element that directs the XML Reader to set the feature type of an FME feature.
  2. attributes element:is an optional element that directs the XML Reader to set one or more attributes for an FME feature.
  3. 几何元素是指示XML读取器构造FME的几何形状的可选元素。