GIF Rasterizer Feature Representation

In addition to the generic FME feature attributes that FME Workbench adds to all features (see About Feature Type Attributes), this format also adds format-specific attributes (Format Attributes).

FME considers the FME feature type of a GIF-destined feature to be its color. The feature type must match a color name defined in the Feature Type format attributes.

Attribute Name Contents

gif_type or

png_type

This will always be gif_raster or png_raster.

gif_raster_filename or png_raster_filename

 

This is a string that specifies a destination filename without the extension. By default, it is used as the basename of the destination file or files.

See About FME Rasters for more details.

Special FME feature attributes direct the writer as it renders the feature into the image. The most important of these is the gif_type attribute because it controls the overall interpretation of the feature. The acceptable values for gif_type are gif_text, gif_line, gif_polygon, and gif_point. The parameters specified to each of these are described below.

Polygons

gif_type: gif_polygon

The GIF writer renders polygonal features first, so as not to obscure any linear, text, or point features. Three-dimensional features are ordered by elevation, so that higher elevations overlay lower elevations. Two-dimensional areas are treated as having an elevation of 0.

The boundary is rendered in the same manner as a gif_line. It is drawn in the color named by the polygonal feature’s feature type. The gif_line attributes – described in the next subsection – are all interpreted when a gif_polygon is output.

In addition to rendering the boundary of a polygon, the GIF writer also fills the polygon with either a solid color or a pattern. The feature attributes, described in the following table, control the filling of a polygonal feature. If neither attribute is specified, the polygon is not filled.

If an image map is being produced, the gif_href and gif_alt attributes are used for the entry for the polygon in the image map. If no image map is being created, then these attributes are ignored.

The GIF writer correctly renders donut polygons by drawing the hole boundaries in the same color as the outer boundary and not filling them.

Attribute Name Contents

gif_fill_color

This attribute holds the name of the color used to fill the polygon. This attribute must not be present if the gif_fill_image is set.

Range: Any defined color name

Optional: Yes

gif_fill_image

The GIF writer can fill the polygon using an arbitrary pattern as a brush. The value of this attribute is the name of a GIF file to be used as the brush.

If the brush image contains any transparent pixels, they will be interpreted correctly and will not obscure any image data already present in the image. If the image is too large to fit into the polygon, it is clipped; and if it is too small, it will be tiled.

This attribute must not be present if the gif_fill_color is set.

Range: Any valid GIF file

Optional: Yes

gif_href

This attribute contains a URL that will be jumped to when the image is displayed in a web page in conjunction with the image map. This is only used when an image map is being produced.

While any URL may be jumped to, a typical use is to have a URL which will display the attributes of the polygon. For example:

javascript:alert('Significant Area\nNAME: Poe’)

The \n embedded in such a java script URL causes a carriage return to be output in the dialog box that is displayed.

Range: Any valid URL

Optional: Yes

gif_alt

This attribute contains a string which will be output to the image map produced with the gif as the alt string for the polygon.

Some browsers will display the alt string as a tool tip when the mouse is over the polygon in the image. However, many browsers do not seem to implement this documented functionality of HTML.

Range: Any string

Optional: Yes

Lines

gif_type: gif_line

The GIF writer renders linear features into the image after all polygons have been drawn. Linear features must have at least two points.

Three-dimensional features are ordered by elevation, so that higher elevations overlay lower elevations. Two-dimensional lines are treated as having an elevation of 0.

The GIF writer supports a variety of line rendering options, controlled by the feature’s attributes. The color for the line is taken from the feature’s feature type. By default, if none of the attributes listed below are specified, a single pixel-width solid line is drawn.

Attribute Name Contents

gif_brush_width

By default, the line drawn is one pixel wide. If a thicker line is desired, this attribute is used to set the width. This attribute must not be present if the gif_brush_image is set.

Range: Integer > 1

Optional: Yes

gif_brush_image

The GIF writer draws the line using an arbitrary pattern as a brush. The value of this attribute is the name of a GIF file to be used as the brush.

If the brush image contains any transparent pixels, they are correctly interpreted and will not obscure any image data already present in the image.

This attribute must not be present if the gif_brush_width is set.

Range: Any valid GIF file

Optional: Yes

gif_dash_on

The number of pixels to be used as the "on" part of the dashed line used to draw the feature.

If gif_brush_width or gif_brush_image are specified, then this value is multiplied by the size of the brush to determine the number of pixels.

Range: Integer > 0

Optional: Yes

gif_dash_off

The number of pixels to be used as the "off" part of the dashed line used to draw the feature.

If gif_brush_width or gif_brush_image have been specified, this value is multiplied by the size of the brush to determine the number of pixels.

Range: Integer > 0

Optional: Yes

gif_href

This attribute contains a URL that will be jumped to when the image is displayed in a web page in conjunction with the image map. This is only used when an image map is being produced.

While any URL may be jumped to, a typical use is to have a URL that will display the attributes of the polygon. For example:

javascript:alert('River\nNAME: Fraser’)

The \n embedded in such a JavaScript URL causes a carriage return to be output in the dialog box that is displayed.

Range: Any valid URL

Optional: Yes

gif_alt

This attribute contains a string which will be output to the image map produced with the gif as the alt string for the line.

Some browsers will display the alt string as a tootip when the mouse is over the polygon in the image. However, many browsers do not seem to implement this documented functionality of HTML.

Range: Any string

Optional: Yes

Points

gif_type: gif_point

The GIF writer renders point features into the image after all polygons and lines have been drawn. Point features must not have more than one coordinate.

Three-dimensional features are ordered by elevation, so that higher elevations overlay lower elevations. Two-dimensional points are treated as having an elevation of 0.

By default, a point is rendered as a single pixel in the color named by the feature type of the point feature. The attributes below may be set to alter this rendering.

Attribute Name Contents

gif_dot_size

By default, the point drawn is drawn as a one pixel dot. If a thicker dot is desired, this attribute is used to set the width and height of a square box drawn at the point’s location. This attribute must not be present if the gif_symbol_image is set.

Range: Integer > 1

Optional: Yes

gif_symbol_image

The GIF writer can draw the point using an arbitrary symbol. The value of this attribute is the name of a GIF file to be used as the symbol. If the symbol contains any transparent pixels, they will be interpreted correctly and will not obscure any image data already present in the image. This attribute must not be present if the gif_dot_size is set.

Range: Any valid GIF file

Optional: Yes

gif_symbol_scale_x

When the gif_symbol_image is specified, this parameter is used to scale the image in the x direction. A value of 1 leaves the symbol unchanged. A value between zero and one shrinks the image, while a value greater than one increases the image.

Range: Integer > 0

Default: 1

Optional: Yes (allowed only when gif_symbol_image is set)

gif_symbol_scale_y

When the gif_symbol_image is specified, this parameter is used to scale the image in the y direction.

Range: Integer > 0

Default: 1

Optional: Yes (only allowed when gif_symbol_image is set)

gif_href

This attribute contains a URL that will be jumped to when the image is displayed in a web page in conjunction with the image map. This is only used when an image map is being produced.

While any URL may be jumped to, a typical use is to have a URL which will display the attributes of the polygon. An example would be:

javascript:alert('Oil Well\nNAME: Leduc #2’)

The \n embedded in such a JavaScript URL causes a carriage return to be output in the dialog box that is displayed.

Range: Any valid URL

Optional: Yes

gif_alt

This attribute contains a string which will be output to the image map produced with the gif as the alt string for the point.

Some browsers will display the alt string as a tool tip when the mouse is over the polygon in the image. However, many browsers do not seem to implement this documented functionality of HTML.

Range: Any string

Optional: Yes

Text

gif_type: gif_text

The GIF writer renders text features into the image after all polygons, points, and lines have been drawn.

The font for a text feature can be selected from one of five predefined fonts, or may be one of the Hershey fonts supplied in the HERSHEY subfolder of the FME distribution. The text cannot be rotated or precisely sized using the predefined fonts, but can be both rotated and resized when using the Hershey fonts.

Text features must have a single point as their coordinate. With the predefined fonts, the text string is output centered around this point. If the text string would extend past the bounds of the image, it is clipped. Use of Hershey fonts allows more flexible justification of the text.

GIF text features have the following attributes:

Attribute Name Contents

gif_text_string

The text string to be drawn into the image. It may contain blanks and there is no limit on its length.

This attribute must be present for all gif_text features.

gif_text_height

The height of the text, measured in ground units. This is applicable only to the Hershey fonts; the gif_font_* fonts have fixed heights.

Range: Floating point > 0

Default: 10

Optional: Yes (used only when gif_font defines one of the Hershey fonts)

gif_text_rotation

The amount of rotation to be applied to the text, measured in degrees counter-clockwise from the horizontal.

Range: Floating point >= 0

Default: 0 (horizontal)

Optional: Yes (used only when gif_font defines one of the Hershey fonts)

gif_font

The font to be used to render the text.

Range:

There are five built-in fonts that may be used:

  • gif_font_tiny
  • gif_font_small
  • gif_font_medium
  • gif_font_large
  • gif_font_giant

In addition to the built-in fonts, there are several Hershey vector fonts distributed with FME. These are defined by the *.hmp files in the hershey subfolder of the FME installation folder.

To use one of these fonts, the name of the file without the .hmp suffix is given as a font name. The currently available Hershey fonts are:

  • Gothice
  • Gothicg
  • Gothici
  • Italicc
  • Italict
  • Romanc
  • Romand
  • Romanp
  • Romans
  • Romant
  • Scriptc
  • Scripts

gif_text_vertical_
justification

Specifies the vertical position of the text’s location point relative to the displayed text.

Range: Literal text string: gif_top, gif_center, or gif_bottom

Default:gif_bottom

Optional: Yes (used only when gif_font defines one of the Hershey fonts)

gif_text_horizontal_justification

Specifies the horizontal position of the text’s location point relative to the displayed text.

Range: Literal text string: gif_left, gif_center, or gif_right

Default:gif_left

Optional: Yes (used only when gif_font defines one of the Hershey fonts)

gif_text_boldness

Specifies the width of the brush used to draw the text, measured in pixels.

Range: Integer > 0

Default:1

Optional: Yes (used only when gif_font defines one of the Hershey fonts)

The hershey subfolder of the FME installation folder contains the Hershey font data from Bill Thoen’s freeware Hershey font set.