To review, GRASS is a set of separate modules operating within a specific environment. The GRASS prompt GRASS4.1> is transparent to UNIX, and merely signifies that the necessary global environment variables have been set to run GRASS modules. All standard UNIX functions are available at the GRASS prompt.
GRASS raster and vector files are actually multiple files in separate subdirectories within your mapset. The entire GRASS database structure begins with the GRASS database /home/strauss/usrb/grass.data. This includes several subdirectory locations. When you start a GRASS session in a location, GRASS creates a mapset subdirectory for you under that location.
One of the big advantages of GRASS is that its data structures are all open, meaning that you can mess around with the data at any level you like. You can edit individual vector feature vertices or raster header data with a text editor. (Just be sure you know what you're doing!)
Your mapset has multiple subdirectories containing component files for raster, vector and site maps. These are created by GRASS as needed. Complete information on GRASS data structures is available in the GRASS Programmer's Guide. The basics are summarized here.
Raster maps have as many as 7 component files in the following subdirectories:
Reclass maps don't have their own cell files, but merely reference cell values in another raster map.
proj: 1 zone: 13 north: 4928000 south: 4914000 east: 609000 west: 590000 cols: 633 rows: 467 e-w resol: 30 n-s resol: 30 format: 0 compressed: 1Supported projections are unreferenced (0), UTM (1), state plane (2) and lat-long (3). The bounding coordinates define the actual map edges, not the centers of the grid cells at the map corners. Although the cellhd file defines the default region for the raster map, it will be displayed and analyzed according to whatever current region settings are defined in the WIND file.
A reclass map's cellhd file simply contains a list of reclassification values for the cell values in the raster map it references. The region information is taken from cellhd file of the map it references.
# 6 categories map title <automatic label format> <automatic label parameters> 0:no data 1:description of category 1 ... 6:description of category 6Category files are created automatically with blank default labels, and can be edited with r.support.
Note that GRASS uses zero to denote missing data, and thus does not distinguish between missing data and true zero values. While this can cause occasional inconveniences, you can generally find simple work-arounds to handle true zeroes.
% 0 240 1:255:0:0 80:255:255:0 80:255:255:0 160:0:255:0 160:0:255:0 240:255:255The first line specifies the range of values; the next line specifies a color ramp from red (255,0,0) to yellow (255,255,0) for values between 0 and 80; etc.
If a map doesn't have a color table file, GRASS uses a default yellow-green-cyan-blue-magenta-red color table.
Vector maps have as many as 6 component files in the following directories:
ORGANIZATION: USGS-NMD DLG DATA DIGIT DATE: 3/6/1977 DIGIT NAME: grass MAP NAME: RAPID CITY, SD MAP DATE: 1977 MAP SCALE: 100000 OTHER INFO: RC3.RRT01 ZONE: 13 WEST EDGE: 579501.42 EAST EDGE: 620264.89 SOUTH EDGE: 4872144.15 NORTH EDGE: 4928285.02 MAP THRESH: 100.00 VERTI: A 2 4872144.15 580178.06 4927677.48 579501.42 L 3 4927677.48 579501.42 4927950.66 599367.48 4928063.45 606138.21 ....
A 123456.89 6789012.34 5 L 123457.90 6789123.45 6 ....The format is fairly strict: the A or L is in column 1; the easting coordinate is right-justified to column 15; the northing coordinate is right-justified to column 29; the feature attribute number (ID) is right-justified to column 39; the (non-printing) newline character is in column 50. (The size of each dig_att file should be a multiple of 50.) Note that the points in the dig_att file are stored as easting-northing, while vertices in the dig_ascii file are stored as northing-easting.
The v.to.rast module converts vector features to raster maps. Each vector feature with an attribute value entry in the dig_att file is rasterized with that value. Features lacking an entry in the dig_att file are not converted.
Sites maps require only a single file in the site_lists directory. A sites file has two header lines followed by a line for each site specifying easting and northing coordinates and the site name or attribute value, e.g.:
name|archsites desc|Potential historic and archealogical sites 593493|4914730|1 Signature Rock 591950|4923000|2 No Name 589860|4922000|3 Canyon Station 590400|4922820|4 Spearfish Creek ....
The "|" character is default field separator in a site_lists file.
The GRASS file management modules g.copy, g.rename, g.remove handle all component files for raster and vector maps simultaneously. It is generally more efficient to use these modules than the UNIX cp, mv or rm commands.
g.mapsets accesses (read-only) others' mapsets.
g.list displays contents of your and other accessed mapsets.
g.access changes permissions on your own mapset.