Geometry Element
A feature mapping rule may contain an optional <geometry> element that specifies the construction of the FME feature’s geometry through a geometry builder. A geometry builder can construct one of the following geometries:
- point geometry: is a single coordinate geometry, the coordinate maybe x,y, or x,y,z. When this geometry is given to the FME feature, the feature’s xml_type attribute is set to xml_point.
- line geometry: is a polyline, it contains at least 2 coordinates, the coordinates may be x,y, or x,y,z. When this geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_line.
- area geometry: is either a single closed polyline, a donut, or an aggregate of donuts/and or simple closed polylines. The coordinates may be x,y or x,y,z. When this geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_area.
- homogeneous aggregate geometry: is a collection of like geometries. A member of the aggregate may itself be an aggregate as long its xml_type matches. When this geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to either xml_point, xml_line, or xml_area.
- heterogenous aggregate geometry: is a collection of geometries which may differ from one another. A member of this aggregate type may be any type of geometry. When this geometry is given to the FME feature, the features’s xml_type attribute of the feature is set to xml_aggregate.
- text geometry: is a text value, a size and a rotation and a location. When this text geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_text.
- path geometry: a curve geometry composed of curve segments. A curve segment maybe a a line or an arc. When this path geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_line.
- arc geometry: an arc geometry is a circular or elliptical curve segment, see the
xml-arc, xml-arc-by-center-point,
andxml-elliptical-arc
geometry builders for the supported arc definitions. When this path geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_arc. - surface geometry: is a surface geometry composed of three dimensional areas. When this surface geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_surface.
- solid geometry: is a solid geometry composed of three dimensional surfaces. When this solid geometry is given to the FME feature, the feature’s xml_type attribute of the feature is set to xml_solid.
The <geometry> element has an activate attribute that specifies the name of a geometry builder. For a geometry builder to do anything useful (that is, construct a geometry), we must supply it with data, we can do this with the geometry builder’s data parameters. The data is supplied through the <geometry> element’s child <data> elements. The general form of a <geometry> element is:
<geometry activate=”...”> <data name=”...”> <!-- the value is some expression sequence --> </data> ... <data name=”...> <!-- an expression sequence --> </data> </geometry>
In a feature mapping rule the <geometry> element must come after the <feature-type> and <attributes> elements.
Later in this section, the XML Reader’s built-in geometry builders and their data parameters are described, custom geometry builders are described in their own sections. In order to understand how a geometry builder constructs the geometry of a FME feature we first explain the states of a geometry builder.