The user can run this program either non-interactively or interactively. The program will be run non-interactively if the user specifies program arguments on the command line, using the form:
Alternately, the user can simply type m.dem.extract on the command line, without program arguments. In this case, the user will be prompted for needed parameter values using the standard GRASS interface described in the manual entry for parser .
Warning: This program assumes that the tape has ONLY DEM data. If the tape contains other files (DLG, for example) the program will not skip over them. In this case, forward the tape to the first DEM file. Use the appropriate UNIX commands (mt to forward the tapes past the non-DEM files, and dd to extract and copy the correct files) on the tape on another machine first to extract the non-DEM data from the tape.
USGS Tapes: This version of m.dem.extract is sensitive to formatting errors. If the format on a tape is wrong, the program exits with the error message: "The file with incorrect data format encountered ..." Nevertheless, the program continues. In this case, run the program without specifying input files. If the program exits again with the same error message, there is an inconsistency in the data format.
The format error: Each USGS Dem file consists of A and B, and sometimes
C, records--
type A record header
type B record collection of profiles with various numbers of
elevations
type C record accuracy
This new version of m.dem.extract cannot skip over any records to the end of a DEM file. It first determines how many records there are in a file, reads those records, and then proceeds to the header (record A) of the next file. Thus it is very important for the program to know whether or not there is a C record to be read at the end of each file. This information is given in the file's header record (type A) which has a field set to 1 when a C-record exits, and to 0 when a C-record does not exist.
In some DEM files, the accuracy field is set to 0, even though a C-record does exist. Because of this error, when the program tries to read the data, it will not try to read the C-record, but instead attempts to go on to the next file and read its header--a type A record. This results in the format error because type A records and type C records have different formats, and the program is trying to read a type A record when the tape is presenting a type C record.
When this format error in a file is encountered, forward the tape to the next file.
Improvements to program code were made for GRASS 4.0 by
David Satnik, Central Washington University
Major enhancements for GRASS 4.1
to allow the input to be a file or tape were made by
Olga Waupotitsch, U.S.Army Construction Engineering
Research Laboratory
Last changed: $Date: 2002/01/25 05:45:33 $