Geometry Traits (trait element)

Aelement may have any number of optionalelements. These elements specify any number of geometry traits for the geometry that is under construction. Geometry traits passed to the geometry builder in this manner will appear on the geometry currently being constructed, but will not affect any component geometries in the case that the traits are passed to a composite builder.

的geometry traits supplied are represented as name and value pairs, both of which have expression sequences as their values. They are represented in the xfMap by the,, andelements:

        ...  ... 

的optionalrequiredattribute on the trait element defaults totrue, if set tofalsethen the trait is added to the geometry only if the trait value is not the empty string.

的optionalnillableattribute on the trait element defaults to false. If nillable is not specified, or if it is false, FME will interpret an empty trait element as an empty string trait and add it to the geometry. If nillable is true, FME will interpret an empty trait element as a null trait value and add it to the gemetry.

Once again, if theelement does not have anactivateattribute, then the traits will pass to the currently suspended geometry builder, reactivating it to receive traits.

的following xfMap document, traits.xmp contains a mapping rule which matches a从points1.xml文档元素。的mapping rule contains a geometry element with a couple of simple traits.

points1.xml

    0.324 0.233 0.596      0.874 0.948 0.554    

traits.xmp

               <trait>        > <trait>        >    

When the above points1.xml and traits.xmp documents are fed into the XML Reader, the following FME features are constructed:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: myPoint_0'
Attribute(string): fme_feature_type' has value myPoint_0'
Attribute(string): fme_geometry' has value fme_point'
Attribute(string): fme_type' has value fme_point'
Attribute(string): xml_type' has value xml_point'
Coordinate System: '
Geometry Type: IFMEPoint
Number of Geometry Traits: 2
GeometryTrait(string): my_geometry_trait' has value sample_value'
GeometryTrait(string): point_num' has value 0'
Coordinate Dimension: 2
(10,0)
============================================================================

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: myPoint_1'
Attribute(string): fme_feature_type' has value myPoint_1'
Attribute(string): fme_geometry' has value fme_point'
Attribute(string): fme_type' has value fme_point'
Attribute(string): xml_type' has value xml_point'
Coordinate System: '
Geometry Type: IFMEPoint
Number of Geometry Traits: 2
GeometryTrait(string): my_geometry_trait' has value sample_value'
GeometryTrait(string): point_num' has value 1'
Coordinate Dimension: 2
(5,5)
============================================================================