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 subsequent sections.

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.

Layers

GRD files use a layers concept to organize all features they contain. Every feature lies on one of the many layers that may be defined. Each layer has a unique name and defines colors, line styles, font styles, etc. for use with all features on that layer that do not have overriding settings. Layers may be either Drawing or Markup types. Every GRD file has the following two mandatory layers:

  • Layer “0” — the drawing layer
  • Layer “Markup 0” — the markup, or inking, layer

Any number of other layers may be defined by the user.

Linetypes

Linetypes are used to define the way line work is meant to be displayed. When reading from GRD files, several linetype specific attributes are given to each feature. Together they define the linetype that it is meant to be displayed with. When writing GRD files, these linetype specific attributes, if present, are stored as the linetype to use. By default, a linetype of CONTINUOUS is used when writing GRD files.

A linetype definition has a name and a description that appears to the user. Usually the description shows what the linetype looks like by using underscores (‘_’) and spaces (‘ ’), for example: ““__ __ ______ . __ __”. The actual linetype definition consists of a series of dashes. There are a maximum of 12 dashes that can make up a linetype. Here is how the linetypes are represented:

  • Dash: Positive dash length where the length is the length of the dash.
  • Space: Negative space length where the length is the absolute value of the space.
  • Dot: Dash length of zero.

To represent this linetype ““__ __ ______ . __ __ ”, the following dashes would be necessary: 2, -2, 2, -2, 4, -2, 0, -2, 2, -2, 2, -2

The details of how this information is represented in FME attributes is found in this section under the heading Linetypes Representation.

GRD Numeric Color Associations

The numeric color values referred to in GRD files have the following associations:

GRD Numeric
Color Value

Description

0

black

1

blue

2

green

3

cyan

4

red

5

magenta

6

brown

7

light gray

8

gray

9

light blue

10

light green

11

light cyan

12

light red

13

light magenta

14

yellow

15

white

16

visible (pen) or transparent (brush)

17

use layer’s color

18

use block’s color (valid only for block entities)