Review the chapters of the GRASS Programmer Guide containing detailed descriptions of the raster, vector and sites data structures as needed. This lecture covers ASCII translations and raster-vector-sites conversions within GRASS. You should try to get comfortable with GRASS ASCII formats. GRASS supports some direct translations to and from some other spatial data formats, but you can always fall back on translations through ASCII if necessary.
Raster files can be converted to ASCII (standard text) format with r.out.ascii, subject to the current region and mask. Output defaults to the screen (stdout), unless redirected to a file. r.out.ascii does not retain the source map's colr or cats files (which are already in ASCII format), so copy these along with the ASCII raster file if you want them.
r.in.ascii converts ASCII text to GRASS raster files.
NOTE: Output from the GRASS 4.0 version of r.out.ascii included projection and zone specifications in the header information; the GRASS 4.1 version of r.out.ascii omits these. If you are using another GIS's GRASS import/export utility (such as IDRISI's GRASSIDR utility), it may expect to have these extra (7th and 8th) header lines, so you will have to insert them with a text editor:
proj: 0 zone: 0
Vector files are converted to ASCII with v.out.ascii without regard to the current region or mask. Output is placed in the dig_ascii directory within the user's mapset. The output combines the vector categories from the dig_att file with the feature vertices, but does not include the labels from the dig_cats file.
v.in.ascii converts ASCII vector files located in the dig_ascii directory within the user's mapset to binary format (in the dig directory) with an associated attribute (dig_att) file. You should run v.support on the resulting binary file immediately afterwards to build its topology (dig_plus) and category (dig_cats) files.
Sites files are already in ASCII format, and directly editable or exportable. GRASS sites files are stored in the site_lists directory in the user's mapset, and their format is somewhat strict: E|N|#n label. The modules s.out.ascii and s.in.ascii are sometimes useful for re-formatting or using different field delimiter characters.
Data conversions within GRASS between raster, vector and site formats are mostly straightforward.
Conversions from raster:
r.poly converts raster area edges to vector area boundaries. Use the -l flag to obtain smooth lines; otherwise you will obtain "steppy" lines.
r.thin thins linear raster features to single-pixel width. r.line converts raster line features to vector lines or (alternately) area edges. These modules sometimes leave unwanted nodes with small "spurs" which can be eliminated with v.trim.
r.contour translates DEM's into vector contour lines at user-specified intervals.
After any raster-to-vector conversion, you should run v.support on your new vector map to build necessary topology information (the "build" option creates the dig_plus file), or edit the category information (the "edit" option creates and edits the dig_att file). v.support's topology-building can snap nodes within a specified threshold together. Be careful: unless you keep your snapping threshold very small, you can easily end up snapping together all kinds of things you didn't want to.
I haven't tried to convert sparse raster cells to sites, but assume you can convert through vector format with r.line, v.support and then v.to.sites (see below).
Conversions from sites:
s.menu is an interactive multi-purpose utility for editing, rasterizing or generating reports from sites files (located in the site_lists directory within your mapset. Under option 6, you can convert sites data to a simple binary raster file indicating locations. Alternately, if every line in the sites file has the format E|N|#n label where #n label is a numeric category followed by a text label, s.menu will convert the sites categories to equivalent raster categories. Under option 7, you can convert a dense sites file to a raster file representing frequencies of occurrence of sites in each cell.
s.to.vect is a user-contributed module for converting sites files to vector format. Or you can edit the sites file so it is readable by v.in.ascii.
Conversions from vector:
Vector data can be lines or area edges. Rasterizing these creates lines or filled areas respectively. v.to.rast converts (binary) vector maps to raster, creating the cell and hist files for the raster map. The program extracts category/attribute values from the vector map's dig_att file. Vector features with zero or missing attributes will not be rasterized. r.support creates additional support files for the raster map.
v.to.sites converts (binary) vector point data into a sites file in the site_lists directory within the user's mapset. The -a flag makes the program output all vertices (not just points). The -c flag uses the vector categories from the dig_cats file rather than the vector attribute data from the dig_att file as the site attributes.