GRASS

Long name GRASS
Short name GRS
File extension(s) .grs, .grassrc

GRASS is a public domain raster/vector GIS produced by the U.S. government. GRASS dig (vector) files, as well as cell (raster) files are supported by the GDB library for read and write operations.

GRASS filenames may be specified in one of two ways:
  1. If there is a .grassrc file in the user's home directory, a simple filename may be given. The file will then be placed in the correct layer for the file.
  2. If the .grassrc is not present, the user must specify a path along with the filename.

For vector files specified with neither a full path name nor a .grassrc, the dig (binary) version of the vector file will be read from or written to, before any ASCII file. To use an ASCII vector file, a path name which includes a dig_ascii directory must be specified.

The dig_plus file is not modified when a binary file is written to. The user will have to use the grass program v.support to update the dig_plus file.

When GRASS vectors are loaded, both Line and Area arcs are read in as polylines. The dig_att file is also read and processed. Each line attribute is associated with its unique line arc. Area attributes are read in as vector points with an attribute. Area arcs will have an assigned attribute of 0. No attempt is made to assign area attributes to their particular AREA arcs. Georeferencing bounds are imported for vector layers, but the correct georeferencing system is only selected for UTM. All others are mapped to METRE.

Export of GRASS files is supported. These files are exported with a type of "GRS".

Only uncompressed 8-bit, and 16-bit raster layers can be exported, and each raster layer may only contain one channel of imagery.

When GRASS files are written, those lines read in as line arcs or area arcs, are written out as lines or arcs respectively. Added lines are treated as line arcs. Added points will be written out as degenerate line arcs. Points that were read in as AREA attributes will not be written. These points will be written out only to the dig_att file.

The non-zero attribute of lines will be written out to the dig_att file. The coordinate associated with the attribute will be the midpoint between the first two vertices in the arc ( (P1+P2)/2 ).

Any attributes read in as AREA attributes will be output, unchanged, to the dig_att file.

GRASS files must be placed in the correct location within a GRASS directory tree. The path provided should be for a file in the "cell" or "cellhd" directory for raster output. If a .grassrc is present in the users home directory it should be possible to specify a layer name without a fully specified path.

For vectors the path provided for the output file will determine the type of file that is written out. Paths which include a "dig" directory in the path will result in a binary file, and paths which include "dig_ascii" will produce an ASCII file. In both cases, the attribute file will be written to the "dig_att" directory.

To write out grass format data when an existing GRASS directory tree does not exist, it is necessary to have a cell, and cellhd directory for rasters, or a dig, dig_att and dig_ascii directory for vectors.

For example, to export vector data in data/test.pix to binary GRS format, create two subdirectories: data/dig and data/dig_att. Then choose data/dig/test.grs as the export file. The attributes will be created in data/dig_att/test.grs.

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.