PenMetrics GRD Reader/Writer

The PenMetrics GRD Reader/Writer allows FME to access PenMetrics GRaphical Drawing (GRD) 32-bit format files.

GRD files consist of drawing settings and configuration, as well as a series of vectors, or graphic elements, organized into layers. FME provides broad support for GRD vector types and options. In addition, when GRD data is output, header information may be copied from a supplied template or prototype file.

Overview

The GRD 32-bit file format is the native file format for PenMetrics vector drawings used with applications such as FieldNotes.

GRD files may contain both two-dimensional (2D) and three-dimensional (3D) features. GRD files store feature geometries as well as user-defined attributes. There are 11 kinds of features as follows: points, lines, polylines (including polygons), rectangles, circles, ellipses, arcs, inserts, text, ink, and multi-segmented polylines.

FME looks for an extension of .grd for the input GRD files, but accepts any GRD file as input regardless of the file name or extension. FME considers a GRD dataset to be a single PenMetrics GRD file. GRD files are binary files that consist of a combination of fixed and variable-length binary records.

The information held within the GRD file itself is contained in five separate sections:

  • Header
  • Linetypes
  • Layers
  • Blocks
  • Layer Vectors

The organization of GRD files closely parallels that of AutoCAD files.

GRD Entity Types and Descriptions

The GRD reader and writer use symbolic names for different entity types stored within a data file. This simplifies feature type specification. The following table gives a brief description of each of the different GRD entity types currently supported by the reader and writer. The entities are described in detail in the topic PenMetrics GRD Feature Representation.

FME grd_entity

Description

grd_line

Linear features stored within the GRD file as a line or unclosed polyline.

grd_point

Point features.

grd_ellipse

Features with an elliptical representation.

grd_circle

Features with an circular representation.

grd_polygon

Features whose geometry is represented by a closed polyline.

grd_arc

Features whose geometry represents a portion of a circular arc.

grd_rectangle

Features with a closed rectangular geometry. The edges are vertical and horizontal only — no rotation.

grd_text

Text features.

grd_ink

Ink features that store images in binary form in a text attribute.

grd_mspline

A group of associated lines are stored as a multi-segmented polyline feature.

grd_insert

Point features that carry insert entity, or block, data.

Reader Overview

The GRD reader opens the input file, immediately starts reading features, and returns them to the rest of FME for processing. The reader has no requirement for definition statements as the user-defined attributes are defined completely within the GRD file itself.

Each returned feature has its feature type set to either the layer name or the geometric type of the feature, as follows: point, line, polygon, rectangle, circle, ellipse, arc, insert, text, ink, or mspline.

Writer Overview

The GRD writer creates and writes feature data to the GRD file specified in the Dataset parameter. Any GRD file with the same name is overwritten with the new feature data.

The GRD writer provides the following capabilities when writing GRD files.

  • User-defined Linetypes: New linetypes can be defined on attributes attached to features being written to the GRD file.
  • User-defined Layers: Users must define the layers into which features are stored. The layers can also define the attributes to be stored within the feature.
  • Copy Block Definitions: Often users have existing GRD data files that contain block definitions they want the translated data to carry. Specifying a Template File in the workspace results in block definitions being copied from the existing file to the output GRD file. These blocks can then be referred to by insert entities.
  • Copy Linetypes: Predefined linetypes within existing GRD files are copied making them available for use by features being written to the destination file. Specifying a Template File in the workspace results in the predefined linetypes being copied from the template file to the output drawing file. Feature entities can then refer to these linetype definitions.
  • Copy Layer Definitions: Layer definitions within an existing GRD file identified by TEMPLATE_FILE enables layer definitions to be copied to the destination dataset and then referenced.
  • Automatic Block Creation: When a feature that cannot be written as a single GRD vector entity is passed to the writer—such as a donut polygon—the writer automatically defines a GRD block and inserts entities necessary to represent the feature.