ldem2viff(3)

LIBRARY ROUTINE
ldem2viff - Convert DEM format data to VIFF format.

LIBRARY CALL
#include "vinclude.h"
int ldem2viff(xv_img, dem_img, loc_flag, scale_factor)
struct xvimage **xv_img;
struct demimage *dem_img;
int loc_flag, scale_factor;

INPUT

    1. viffimage -- a double pointer to a structure of
                     type xvimage. Only a pointer is
                     needed, the structure should not be
                     malloced.
    2. demimage -- a pointer to a structure of type
                     demimage. This structure should be
                     allocated and should contain the DEM
                     data.
    3. location -- a flag which tells this routine if the
                     output viff data should have implicit
                     (0) or explicit (1) location data.
    4. sfactor -- an integer which gives the ratio by
                     which the DEM data should be
                     subsampled before being written to
                     the viff image.

OUTPUT

    1. viffimage -- upon exit this double pointer will
                     point to a struture of type xvimage
                     that is allocated and filled with the
                     viff data.

    viffimage is modified to point to the output structure, so be careful that you do not overwrite an important pointer.

MODIFICATIONS

DESCRIPTION
ldem2viff converts digital elevation map data in the format distibuted by the United States Geological Survey to viff format so that it may be used by the khoros system.

DEM data in both the 7.5-minute and 1-degree formats can be used.

For large files, the data may be subsampled using the -s flag before it is written to the output viff file.

The output may be written with location data using the -l flag. If explicit locations are choosen, the units that the locations are given in depend on the format of the input file. Locations for 7.5-minute data will be given in utm meters, and locations for 1-degree data will be given in arc seconds.

SEE ALSO
dem2viff(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
ldem2viff works with both 7.5-minute and 1-degree DEM files, but the elevation units in either format must be meters. The ground units in a 7.5-minute DEM file must also be meters, and the ground units in a 1-degree DEM file must be arc seconds. A 7.5-minute DEM must use utm coordinates, and a 1-degree DEM must use geographical coordinates. This program reads fixed format data, so it is very sensitive to the spacing of the fields in the input file. If the input file format deviates in any way from the standard DEM format the program will crash.

This program has received only minimal testing with 7.5-minute DEM files.

AUTHOR
Per Lysne

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.