Feature Representation
In addition to the generic FME feature attributes that FME Workbench adds to all features (see About Feature Attributes), this format adds the format-specific attributes described in this section.
CGDEF features consist of geometry but no user-defined attributes, although there are special attributes to hold the type of the geometric entity and its display parameters.
The FME considers the CGDEF overlay name to be the FME feature type of a CGDEF feature. When writing, the CGDEF writer will create a new overlay for each unique feature type that is passed to the writer. All CGDEF features contain a cgdef_type attribute, which identifies the geometric type. Each geometric/element type can also have an id, up to 31 characters long, associated with it. Every element type except symbols will have associated colors attached to it. Both cgdef_symbol_name and cgdef_symbol_sequence_number are fields that are only filled if the element is part of a symbol instance. Depending on the geometric type, the feature contains additional attributes specific to the geometric type. These are described in subsequent sections.
Attribute Name |
Contents |
cgdef_type |
The CGDEF geometric type of this entity. Range: cgdef_symbol cgdef_polyline cgdef_polygon cgdef_text cgdef_ellipse cgdef_arc Default: No default |
cgdef_element_id |
The CGDEF ID for this entity, this is an optional attribute Range: String Default: No default |
cgdef_color.red |
The element’s red color intensity, as determined by looking up the element’s color index in the color table. Range: 0..65535 Default: 27000 (when writing only) |
cgdef_color.green |
The element’s green color intensity, as determined by looking up the element’s color index in the color table. Range: 0..65535 Default: 30000 (when writing only) |
cgdef_color.blue |
The element’s blue color intensity, as determined by looking up the element’s color index in the color table. Range: 0..65535 Default: 38000 (when writing only) |
fme_color |
This is a string that represents the color intensities of the element. It is formatted as red, green, blue intensities which range between 0..1 This 0..1 value is arrived at by taking the color intensity and dividing it by the total intensity range, in this case, 65535 Range: String. (0..1, 0..1, 0..1) Default: 27000/65535, 30000/65535, 38000/65535(when writing only) |
cgdef_symbol_name |
If the element is part of a symbol and the symbol has been exploded into its individual elements, then this field contains the symbol name Range: String Default: None |
cgdef_symbol_ |
If the element is part of a symbol and the symbol has been exploded into its individual elements, then this field contains the a unique number which identifies itself and the other elements in the symbol Range: String Default: None |
Symbols
CGDEF symbol features specify a single x and y coordinate. This coordinate defines the center of the symbol The symbol is defined by a symbol number, and a scale attribute. If no scale is defined, then the symbol will be placed at the current default symbol scale setting.
The table below lists the special FME attribute names used to control the CGDEF symbol settings.
Attribute Name |
Contents |
cgdef_symbol_number
|
This number references a resource in the map. If the symbol number does not have a resource in the map, the default symbol rectangle is placed at the specified location. Range: Any integer number > 0 Default: No default |
cgdef_symbol_scale |
The scale at which the symbol is to be placed. Range: 1..20 Default: 1 |
Symbol and Group Definitions
Symbols are defined as a set of feature/element types. The collection of feature types becomes the symbol. As an example, a symbol can be defined as two circles and an arc, which together form a happy face. Thus, a cgdef_symbol type actually references its definition through the cgdef_symbol_number and places that symbol with appropriate scaling at the coordinates specified in the cgdef_symbol type.
Along the same lines is a group definition. A group is another feature which is made up of a set of other element types. However, a group does not have a group number or group name to identify it (although it may still have an ID which any feature may possess).
FME does not recognize groups; instead, it outputs the elements of the group as independent features.
Text
CGDEF text is used for text annotation in CGDEF. The coordinates specify the lower left coordinates of the text when it is placed. In addition, the size and angle that the text is output can be specified.
The table below lists the special FME attribute names used to control the CGDEF text:
Attribute Name |
Contents |
cgdef_text_size |
The size of the text specified in ground units of the map. Range: float > 0 Default: 0 |
cgdef_text_angle |
The text angle is given in degrees and measured from the horizontal. Range: -360..360 Default: 0 |
cgdef_text_font |
The type of font. Range: String Default: No default |
cgdef_text_style |
The display style for the text. Range: String Default: No default |
cgdef_text_string |
The text to be displayed Range: String Default: No default |
Polylines
CGDEF polyline features specify linear features defined by a sequence of x and y coordinates. Polylines encapsulate the concept of a line since a line is just a sequence of two points. Furthermore, the polyline type will be used with the cgdef_arc type to handle poly arcs used in MapGraphix. Poly arcs will be represented by a sequence of polylines and arcs.
Each polyline has a pen style associated with it specifying the color, line weight, and line type used when the line is drawn. If no pen style is defined for a polyline entity, the previous style is used.
The table below lists the special FME attribute names used to control the CGDEF polyline settings.
Attribute Name |
Contents |
cgdef_pen_lineweight |
Defines the lineweight used to draw the polyline. This is measured in screen pixels. Range: 1..127 Default: 1 |
cgdef_pen_linetype |
The linetype used to draw the line. Range: 1..19 Default: 1 |
Polygons
CGDEF polygon features specify area (polygonal) features. The areas that make up a single feature may or may not be disjoint, and may contain polygons that have holes. Each polygon has a pen style associated with it to control the color, line weight, line type, and brush pattern used when it’s drawn. If no pen style is defined for a polygon entity, the previous style is used.
The following table lists the special FME attribute names used to control the CGDEF polygon settings.
Attribute Name |
Contents |
cgdef_pen_lineweight |
Defines the lineweight used to draw the polyline. This is measured in screen pixels Range: 1…127 Default: 1 |
cgdef_pen_linetype |
The linetype used to draw the line. Range: 1...19 Default: 1 |
cgdef_brush_pattern |
The pattern used to draw the line. Range: 1…41 Default: 1 |
Ellipse
The cgdef_ellipse corresponds to ovals in MapGraphix.
Ellipse features are point features, and have only a single coordinate. This point serves as the center of the ellipse. Additional attributes specify the primary axis (X) and secondary axis (Y) of the ellipse. CGDEF ellipses also support rotation.
Tip: Tip: The primary ellipse axis is not necessarily the longest axis, but rather the one on the x axis.
CGDEF ellipses can also arrive at circles, since circles are just ellipses with equal primary axis and the secondary axis.
In addition to the attributes below, ellipses also make use of the brush and pen attributes as defined by cgdef_polygon.
Attribute Name |
Contents |
cgdef_primary_axis |
The length of the semi-major axis in ground units. (x-axis) Range: Any real number > 0 Default: No default |
cgdef_secondary_axis |
The length of the semi-minor axis in ground units. (y-axis) Range: Any real number > 0 Default: No default |
cgdef_rotation |
The rotation of the major axis. The rotation is measured in degrees counterclockwise up from horizontal. Range: -360.0..360.0 Default: 0 |
Arc
The arc definition here handles arcs, oval arcs and parts of poly arcs used in MapGraphix. Poly arcs use the cgdef_arc type as well as cgdef_polyline types to form the original poly arc defined in the CGDEF file.
CGDEF arc features are linear features used to specify elliptical arcs. As such, the feature definition for cgdef_arc is similar to the ellipse definition, with two additional angles to control the portion of the ellipse boundary drawn. CGDEF arcs also support rotation.
Tip: The ArcStroker transformer can be used to convert an arc to a linestring. This is useful for storing Arcs in systems that do not support them directly.
In addition to the attributes below, arcs also make use of the pen attributes as defined on cgdef_polyline.
Attribute Name |
Contents |
cgdef_primary_axis |
The length of the semi-major axis in ground units. (x-axis) Range: Any real number > 0 Default: No default |
cgdef_secondary_axis |
The length of the semi-minor axis in ground units. (y-axis) Range: Any real number > 0 Default: No default |
cgdef_start_angle |
How FME calculates start_angle and sweep_angle Range: 0.0..360.0 Default: 0 |
cgdef_sweep_angle |
How FME calculates start_angle and sweep_angle Range: 0.0..360.0 Default: No default |
cgdef_rotation |
The rotation of the major axis. The rotation is measured in degrees counterclockwise up from horizontal. Range: -360.0..360.0 Default: 0 |