Style File Specification

GRS applications display user-supplied ESRI shapefiles containing lines and polygons. User-created style files are describe the shapefile and how to display the shapes within them. 

Style files are simple text files containing single line statements using the following syntax:

; Everything after ';' is a comment
Color: "field" "value" threshold r g b
Status: field [field [field]]

Color: "field" "value" threshold r g b

The Color statement selects shapes whose associated field matches the value given. When the display width is less than or equal to threshold (given in miles), the shape is drawn in the color given by rgb. There can be up to 32 Color statements in a style file.

Status: field [field ...]

The Status statement selects the fields that will be shown on the left side of the status bar when the mouse cursor is positioned over a displayed shape. Up to eight fields can be specified. The fields are separated by single spaces. Note that no quotes are needed around the field names. 



Here is a style file for importing TIGER road shapefiles:

; Sample TIGER road style file

Color: "CFCC2" "A1"  70   255   0   0
Color: "CFCC2" "A2"  70   192 128   0
Color: "CFCC2" "A3"  50   128  64   0
Color: "CFCC2" "A4"  10   128  92  92
Color: "CFCC" "A63"  10   192   0   0

The status line text will be the concatenation of the from address number (FRADDR), the road direction prefix (FEDIRP), the road name (FENAME), the road type (FETYPE), and the road direction suffix (FEDIRS) attributes.

The color statements select the road types to import, their view threshold, and their color. See the documentation on the TIGER shapefile format for more information on the fields used (1.2 MB PDF): Census 2000 Tiger/Line File Technical Documentation. Specifically, the description of the "Census Feature Class Codes (CFCC)" starting on page 3-26.

The TIGER style file produced the following display: