User's Guide

GETELEV

Gets the elevation of a tie point from a DEM image file

Function:

Gets the elevation of a tie point from a Digital Elevation Model (DEM) image file and writes an output tie point location (TPL) file.

Parameters:

IN
Input image. This must be a single-band image containing elevation date (DEM image). The projection and location information in the image's DDR file must be valid if non-image coordinates are specified. Windowing is ignored, but a band specification may be entered to specify one band of a multi-band image.

INTL
Input tie point location file. This file contains geographic, projection, or image coordinates which are used to find a corresponding elevation in the DEM. This file must have valid projection information if non-image coordinates are specified.

OUTTL
Output tie point location file. This tie point location file contains the same information as the input tie point location file except the elevation fields have been filled or modified.

COOROPT("YX")
Coordinate option. Specifies which type of coordinates are used in INTL.

  = YX:    Geo/Proj/User coordinates.  Geographic, projection, or 
           user-defined coordinates are used in INTL.
  = IMAGE: Image coordinates.  Line/Sample image coordinates are 
           used in INTL.

REPFLG("NO")
Replacement flag. Replace the current TPL elevation. If REPFLG = YES an elevation will be retrieved from the input image for each point in INTL file. IF REPFLG = NO, all all non-zero elevations currently in INTL will be copied to OUTTL. Only those points that have an elevation of zero will have their elevations retrieved from IN.

  = YES:   Replace elevation
  = NO:    Use current elevation

PRINT(TERM)
Output destination. The destination of the output information pertaining to the success of the elevation search for each tie point in INTL.

  = --:        No Report
  = TERM:      Terminal.  Output is sent to the user's terminal.
  = LP:        Line printer.  Output is sent to the printer defined 
               by $PRINTER.
  = Filename:  User-supplied filename.  Output is sent to the user-
               supplied file with the extension ";prt".

Example:

  1. LAS> getelev in=dem intl=control outtl=elev print=term

    All input tie point information from CONTROL;TPL and the corresponding elevation values from the input file DEM;IMG are written to the output tie point location file ELEV;TPL. Messages to the user pertaining to the success of each elevation value search are displayed on the terminal.

Description/Algorithm:

The input TPL file and the input DEM image are both opened. If COOROPT="YX", the tie point location header record and the DEM DDR record are checked for valid projection and location information. This information must be present for processing to continue. Next, the projection transformation package is initialized and the output tie point location file is created.

Each point from the input tie point location file is processed in the following manner:

    o  The tie point record is read from disk.

    o  If the replace option is set to NO and an elevation 
       is contained in the record, notify the user, write 
       the tie point record to the output file "as is", and 
       get the next record.  Otherwise: 

    o  Convert the geographic or projection coordinate of the 
       tie point to the projection space of the DEM image.  
       Then, convert the coordinates to the nearest line and 
       sample in the DEM image.

    o  If the line and sample coordinate is outside the image, 
       notify the user, set the elevation to zero, write the tie
       point record to the output file, and get the next record.  
       Otherwise:

    o  Read the DEM image line containing the elevation, assign 
       the elevation at the calculated sample location to the tie
       point elevation field, write the tie point record to the 
       output tie point location file, and get the next record.

When the last record in the INTL file has been processed, all files are closed and processing completes.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [getelev-alloc] Error allocating memory

    An error occurred allocating memory. Rerun the function and, if the error persists, notify the system manager.

  2. [getelev-fatal] Fatal error encountered

    The error message displayed immediately preceding this message is the specific error encountered. Processing is terminated.

  3. [getelev-noproj] Projection info not available from DEM DDR

    The output projection information was to be read from the DEM image DDR; however, the DDR contained some invalid information. Correct the DDR projection and location information. (see user note #2)

  4. [getelev-tplproj] TPL file must have valid projection information

    The input projection information was to be read from the header of the input tie point location file; however, the file header contained some invalid information. Correct the projection and location information in the TPL file header. (see user note #3)

User Notes:

  1. Projection coordinates are defined in LAS to be at the center of a pixel.

  2. Projection and location information in an image DDR may be modified with the EDITDDR function.

  3. Projection and location information in the input tie point location file may be modified with the EDITTIE function.