Feature Representation
MIF features consist of geometry and attributes. The attribute names are defined in the DEF line and there is a value for each attribute in each MIF feature. In addition, each MIF feature contains several special attributes to hold the type of the geometric entity and its display parameters.
All MIF features contain the mif_type attribute, which identifies the geometric type. All MIF features may contain either or both of the fme_color and fme_fill_color attributes, which store the color and fill color of the feature, respectively.
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.
Attribute Name |
Contents |
mif_type |
The MIF geometric type of this entity. Range: mif_point mif_polyline mif_region mif_text| mif_ellipse mif_arc mif_rectangle mif_rounded_rectangle mif_collection mif_none Default: No default |
fme_color |
A normalized RGB triplet representing the color of the feature, with format r,g,b. Range: 0,0,0 to 1,1,1 Default: No default |
fme_fill_color |
A normalized RGB triplet representing the fill color of the feature, with format r,g,b. Range: 0,0,0 to 1,1,1 Default: No default |
Points
MIF point features specify a single x and y coordinate in addition to any associated user-defined attributes. An aggregate of point features may also be read or written – this corresponds to the MIF MULTI_POINT primitive type.
A MIF point also specifies a symbol. The symbol is defined by a symbol number, a color, and a size. If no symbol is defined for a point entity, the previous symbol is used.
The table below lists the special FME attribute names used to control the MIF symbol settings.1MapInfo symbols cannot be rotated. However, some third-party add-ons to MapInfo rotate symbols based on a user-defined rotation attribute.
Attribute Name |
Contents |
mif_symbol_color |
The color of the symbol. MapInfo colors are defined in relative concentrations of red, green, and blue. Each color ranges from 0 to 255, and the color value is calculated according to the formula: Range: 0…2^24 - 1 Default: 0 (black) |
mif_symbol_shape |
The number of the symbol. See the MapInfo Reference Manual for a list of the available symbols. Range: 31...67 Default: 35 (a star) |
mif_symbol_size |
The point size of the symbol. Note that this size is not scaled depending on the zoom level. Range: Any integer number > 0 Default: 10 |
Font Points
MIF font point are very similar to MIF points, but allow a symbol based on a TrueType font to be specified. In addition to the font, may specify rotation, color, shape number, size, and style.
The table below lists the special FME attribute names used to control the MIF font point settings:
Attribute Name |
Contents |
mif_symbol_color |
The color of the symbol calculated according to the formula: Range: 0…2^24 - 1 Default: 0 (black) |
mif_symbol_shape |
The number of the shape within the TrueType font to be used as the symbol. Range: Integer Default: No default |
mif_symbol_size |
The point size of the symbol. Range: Integer Default: 12 |
mif_symbol_font |
The name of the TrueType font to be used for the symbol. Range: String Default: No default |
mif_symbol_angle |
The rotation angle for the symbol, measured in degrees counterclockwise from horizontal. Range: -360.0..360.0 Default: 0 |
mif_symbol_style |
The display style for the symbol. Range: 0 (Plain text) 1 (Bold text) 16 (Black border around symbol) 32 (Drop Shadow) 256 (White border around symbol) Default: 0 |
Custom Points
MIF custom points are very similar to MIF points, but allow a bitmap image to be specified as the symbol to be drawn. In addition to the image, color, size, and style may be specified.
The table below lists the special FME attribute names used to control the MIF custom point settings:
Attribute Name |
Contents |
mif_symbol_color |
The color of the symbol calculated according to the formula: Whether or not the color is used depends on the setting of the style attribute. Range: 0…2^24 - 1 Default: 0 (black) |
mif_symbol_file_name |
The name of the bitmap file found in the MapInfo CustSymb folder. Range: String Default: No default |
mif_symbol_size |
The point size of the symbol. Range: Integer Default: 12 |
mif_symbol_style |
The display style for the symbol. Range: 0 (White pixels in the image are transparent, allowing whatever is beneath to show through. Non-white pixels are drawn in the same color as they are in the bitmap.) 1 (White pixels in the image are drawn as white. Non-white pixels are drawn in the same color as they are in the bitmap.) 2 (White pixels in the image are transparent. Non-white pixels are drawn in the color specified by mif_symbol_color.) 3 (White pixels in the image are drawn in white. Non-white pixels are drawn in the color specified by mif_symbol_color) Default: 0 |
Multipoints
MIF multipoint feature specify a number of individual sets of points each defined by an x and y coordinate. All the points share the same attributes and geometry. This is supported as a homogeneous aggregate feature composed of points, font points or custom points.
The MIF multipoint uses the same attribute names control settings as the points, font points and custom point.
Polylines
MIF polyline features specify linear features defined by a sequence of x and y coordinates. Each polyline has a pen style associated with it specifying the color, width, and pen pattern of the line. A polyline may also specify that it is a smoothed line, in which case MapInfo uses a curve fitting algorithm when rendering the line2MapInfo renders smoothed polylines substantially slower than unsmoothed polylines.. If no pen style is defined, the previous style is used.
Note: Tip: MapInfo MIF supports a special type for two point lines. The FME transparently converts such MIF lines into polylines, both as it reads MIF files and as it writes them.
The table below lists the special FME attribute names used to control the MIF polyline settings.
Attribute Name |
Contents |
mif_pen_color |
The color of the polyline. MapInfo colors are defined in relative concentrations of red, green, and blue. Each color ranges from 0 to 255, and the color value is calculated according to the formula: Range: 0…2^24 - 1 Default: 0 (black) |
mif_pen_pattern |
The pattern used to draw the line. See the MapInfo Reference Manual for a list of the available patterns. Range: 1…77 Default: 2 |
mif_pen_width |
The width of the line rendered for the polyline feature. This is measured as a thickness in pixels. A width of 1 is always drawn as a hairline. A width of 0 should be considered to be a line with no width, or a line with no style, or invisible, and should not normally be used. If an invisible line is necessary, it should be created by setting the pattern to 1 (None). If a hairline is desired, the pen should be created by setting the width to 1. The width can be specified as a point width, in which case this formula is used: penwidth = (point width * 10) + 10 Range: 0...7 (pixel width) 11...2047 (point width) Default: 1 |
mif_smooth |
Controls whether or not the polyline will be smoothed when rendered. Range: true|false Default: false |
Regions
MIF region 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 region has a pen style associated with it to control the color, width, and pen pattern used when its boundary is drawn. In addition, a region may set its brush pattern, foreground, and background color to control how its enclosed area will be filled. If no pen or brush style is defined for a region entity, the previous style is used. The following table lists the special FME attribute names used to control the MIF region settings.
Attribute Name |
Contents |
mif_brush_pattern |
The pattern used to fill the area the region contains. See the MapInfo Reference Manual for a list of the available brush patterns. Range: 1…71 Default: 2 (solid) |
mif_brush_foreground |
The foreground color used when the region is filled. MapInfo colors are defined in relative concentrations of red, green, and blue. Each color ranges from 0 to 255, and the color value is calculated according to the formula: Range: 0…2^24 - 1 Default: 0 (black) |
mif_brush_background |
The background color used when the region is filled. (-1 specifies transparent color) Range: -1…2^24 - 1 Default: 16777215 (white) |
mif_pen_color |
The color of the boundary of the region. Range: 0…2^24 - 1 Default: 0 (black) |
mif_pen_pattern |
The pattern used to draw the region’s boundary. See the MapInfo Reference Manual for a list of the available patterns. Range: 1…77 Default: 2 |
mif_pen_width |
The width of the line rendered for the region’s boundary. This is measured as a thickness in pixels. A width of 1 is always drawn as a hairline. A width of 0 should be considered to be a line with no width, or a line with no style, or invisible, and should not normally be used. If an invisible line is necessary, it should be created by setting the pattern to 1 (None). If a hairline is desired, the pen should be created by setting the width to 1. Range: 0...35 Default: 1 |
mif_center_xcoord |
The centroid x coordinate. Range: Any real number Default: 0 Reprojectable: Yes |
mif_center_ycoord |
The centroid y coordinate. Range: Any real number Default: 0 Reprojectable: Yes |
Text
MIF text features are used to specify annotation information. Each text feature can have its font, color, spacing, justification, and rotation angle set independently. The following table lists the special FME attribute names used to control the MIF text settings.
Attribute Name |
Contents |
mif_rotation |
The rotation of the text, as measured in degrees counterclockwise from horizontal. Range: -360.0..360.0 Default: 0 Reprojectable: Yes |
mif_text_fontbgcolor |
The background color used when the text is drawn. Range: 0…2^24 - 1 Default: 16777215 (white) |
mif_text_fontfgcolor |
The foreground color used when the text is drawn. MapInfo colors are defined in relative concentrations of red, green, and blue. Each color ranges from 0 to 255, and the color value is calculated according to the formula: Range: 0…2^24 - 1 Default: 0 (black) |
mif_text_fontname |
The name of the font used to draw the text. The font named must be available on the destination computer system. Range: Default: Arial |
mif_text_fontstyle |
The style code of the text. This flag controls whether the text is bold, underlined, italic, etc. See the MapInfo Reference Manual for a list of style codes and their meanings. The basic range of possible flag settings are listed below. Combinations of various values are also allowed. For example, a value of 6 indicates a bold and italic text style: Range: 0 - Plain 1 - Bold 2 - Italic 4 - Underline 16 - Outline (only supported on the Macintosh) 32 - Shadow 256 - Halo 512 - All Caps 1024 - Expanded Default: 0 (plain text) |
mif_text_height |
The height of the text in ground units. Range: Any real number >= 0 Default: 10 Reprojectable: Yes |
mif_text_justification |
The justification of the text. Range: left | center | right Default: left |
mif_text_spacing |
The spacing between lines of multiline text. The measure is expressed as a multiple of the text height. Range: 1.0 | 1.5 | 2.0 Default: 1.0 |
mif_text_string |
The text to be displayed. Range: Any character string Default: No default |
mif_text_width |
The total width of the text string in ground units. The MIF text representation stores a bounding box for the text, and mif_text_width is the width of the bounding box. Range: Any real number >= 0 Default: 10 Reprojectable: Yes |
mif_text_linetype |
The type of line attaching the text to the anchor point. Range: 0 (None: do not display a line with the label.) 1 (Simple: create a callout by using a simple line that connects the label to the anchor point.) 2 (Arrow: create a callout by using an arrow and line that connects the label to anchor point.) Default: 0 (None) |
mif_text_line_end_x |
The x position of the label line end point. The linetype needs to be 1 or 2 for the label line to be visible. Range: Any real number Default: No default Reprojectable: Yes |
mif_text_line_end_y |
The y position of the label line end point. The linetype needs to be 1 or 2 for the label line to be visible. Range: Any real number Default: No default Reprojectable: Yes |
Tip: Tip: The font color and style settings will not be used unless a font name is specified.
Ellipse
MIF 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 and secondary axis of the ellipse. MIF ellipses currently do not support rotation. For compatibility with other systems, the MIF reader always returns a rotation of 0. If a rotation is specified to the writer, the ellipse is turned into a region, vectorized, and rotated by the amount specified.
Tip: Tip: The primary ellipse axis is not necessarily the longest axis, but rather the one on the x axis.
In addition to the attributes below, ellipses also make use of the brush and pen attributes as defined by mif_region.
Attribute Name |
Contents |
mif_primary_axis |
The length of the semi-major axis in ground units. Range: Any real number > 0 Default: No default Reprojectable: Yes |
mif_secondary_axis |
The length of the semi-minor axis in ground units. Range: Any real number > 0 Default: No default Reprojectable: Yes |
mif_rotation |
The rotation of the major axis. The rotation is measured in degrees counterclockwise up from horizontal. Range: -360.0..360.0 Default: 0 Reprojectable: Yes |
Arc
MIF arc features are linear features used to specify elliptical arcs. As such, the feature definition for mif_arc is similar to the ellipse definition with two additional angles to control the portion of the ellipse boundary drawn. MIF arcs currently do not support rotation. For compatibility with other systems, the MIF reader always returns a rotation of 0. In addition, if a rotation is specified to the writer, the arc is turned into a polyline, vectorized, and rotated by the amount specified.
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 mif_polyline.
Attribute Name |
Contents |
mif_primary_axis |
The length of the semi-major axis in ground units. Range: Any real number > 0 Default: No default Reprojectable: Yes |
mif_secondary_axis |
The length of the semi-minor axis in ground units. Range: Any real number > 0 Default: No default Reprojectable: Yes |
mif_start_angle |
How FME calculates start_angle and sweep_angle Range: 0.0..360.0 Default: 0 Reprojectable: Yes |
mif_sweep_angle |
How FME calculates start_angle and sweep_angle Range: 0.0..360.0 Default: No default Reprojectable: Yes |
mif_rotation |
The rotation of the ellipse that defines the arc. The rotation angle specifies the angle in degrees from the horizontal axis to the primary axis in a counterclockwise direction. Range: -360.0..360.0 Default: 0 Reprojectable: Yes |
Rectangle
MIF rectangle objects are represented in the FME as closed polygons. When a MIF rectangle is read, it is turned into a closed polygon feature. When a MIF rectangle is written, the minimum bounding rectangle of the feature is taken and used as the four corners of the rectangle. MIF rectangles take the same additional attributes as MIF regions to specify their brush and pen.
Rounded Rectangle
MIF rounded rectangle objects are represented in the FME as closed polygons. When a MIF rounded rectangle is read, it is turned into a closed polygon feature and the corners are vectorized to preserve the intended shape of the rectangle. The rounding radius is also stored as an attribute.
When a MIF rounded rectangle is written, the minimum bounding rectangle of the feature is taken and used as the four corners of the rectangle, and the rounding diameter is taken from an attribute of the feature. MIF rounded rectangles take the same additional attributes as MIF regions to specify their brush and pen.
Attribute Name |
Contents |
mif_rounding |
Contains the diameter in ground unit, of the circle used to produce the rounded corners. Range: Any real number > 0 Default: No default |
Collection
MIF collections are defined as a combination of the other feature types. This is represented as non-homogeneous aggregates composed of the other feature types.
To create MapInfo collections using FME, set the mif_type attribute to mif_collection on the feature destined for the MIF dataset. It is important that the feature to be saved as a collection is an aggregate feature.
The table below lists the special FME attribute name used to control the MIF collection settings:
Attribute Name |
Contents |
mif_collection_comp{} Deprecated |
This is the list attribute prefix used to store the attributes for each collection part. The suffixes are the attribute names for the control settings of the other feature types. Range: none Default: none |