User's Guide

LS2PC

Converts line/sample coordinates to projection coordinates

Function:

Converts line/sample coordinates to projection coordinates using a valid DDR.

Parameters:

IN
Input Image. The image's DDR information is used in the calculations and must contain valid projection information.

OUTFILE
Output file. The coordinates computed will be stored in this file with an extension of ".tic" or ".tps", depending on the value of FILETYPE.

LINES(1)
Line coordinates. The line coordinates to be converted to projection coordinates. LINES and SAMPS must have the same number of elements.

SAMPS(1)
Sample Coordinates. The sample coordinates to be converted to projection coordinates. LINES and SAMPS must have the same number of elements.

INFILE(--)
Input file. INFILE is an ASCII text file containing LINE/SAMPLE pairs. When INFILE is specified, the values in LINES and SAMPS are ignored and the contents of the file are used. The file contains the inputs normally found in LINE and SAMPLE. The values in the file must be placed in two columns: the first for the LINE values and the second for the SAMPLE values. The default extension for INFILE is ".txt". For more information on the layout refer to user note 1.

PRINT(--)
Output destination.


  ---:          No report generated.
  = 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".

FILETYPE("TIC")
The filetype that the output is desired in. LS2PC can output to either a tic file or to a tps file.

  = TIC:  Output a TIC file
  = TPS:  Output a TPS file

Examples:

  1. LAS> ls2pc in=image outfile=pc_coords print=pc_out lines=(1 1 512 512) samps=(1 512 1 512)

    The DDR of IMAGE is used to set up a transformation between line/sample coordinates and projection coordinates. The Line/sample coordinates are given in the parameters and the resulting projection coordinates are stored in "pc_out;prt" and in "pc_coords;tic".

  2. LAS> ls2pc in=image outfile=pc_coords print=out_pc,term infile=infile

    The DDR of IMAGE is used to set up a transformation between line/sample coordinates and projection coordinates. The Line/Sample coordinates are read from the file INFILE, the resulting projection coordinates are stored in "out_pc;prt", and in "pc_coords;tic".

  3. LAS> ls2pc in=image outfile=tps_file filetype=tps infile=infile print=term

    The DDR of IMAGE is used to create a TPS files with the line/sample coordinates transformed to projection coordinates. The fields in the TPS Header are filled in from the DDR, and the line/sample coordinates are read from the file INFILE, and the fields in the TPS data structure are filled. The output will be in "tps_file.tps".

Description/Algorithm:

The projection coordinates of the image corners are extracted from the DDR. The projection coordinates and the image coordinates are used to set up a transformation between image and projection coordinates. Then each image coordinate, as entered in the LINES and SAMPS parameters or read from INFILE, is converted to a projection coordinates. These coordinates are written to disk in an ASCII file. They can also be written to a TPS file. This function works on North-up images, as well as images which have the projection system rotated from the image coordinate system.

Nonfatal Error Message:

  1. [ls2pc-info] Specified line/sample file, <xxxxx>, contained no line/sample pairs

    The specified input line/sample file did not contain any input line/sample pairs, therefore the output is empty.

  2. [ls2pc-info] Out of bounds data point: x y

    The data point (x,y) was outside of the line/sample range of the DDR.

Fatal Error Messages:

  1. [ls2pc-alloc] Error allocating memory

    Not enough memory could be allocated. Check with the system administrator on the memory status and re-run.

  2. [ls2pc-close] Error closing TPS file

    An error occured when attempting to close the TPS file.

  3. [ls2pc-elements] LINES and SAMPLE arrays must have same number of elements

    The same number of elements must be entered for LINES and SAMPS.

  4. [ls2pc-fatal] Fatal error encountered

    A fatal error was encountered. The error message displayed immediately preceding this message is the specific error encountered.

  5. [ls2pc-maxnum] Exceedes the maximum number of inputs

    File input exceeded the maximun number of allowed points. A maximum amount of points allowed are 65536 point pairs.

  6. [ls2pc-open] Error opening <xxxxx> file

    The possible problems for this error to occur are: file exists for output file, or filename incorrect for infile, or file permissions not set for read/write access.

  7. [ls2pc-noproj] Projection information not available

    Projection information was invalid. The projection related fields of the geometric mapping grid cannot be calculated.

  8. [ls2pc-pairs] The LINE and SAMPLE values in INFILE must be in pairs Invalid pair at line x

    File data error was encountered. The contents of the data file containing the LINES and SAMPS data needs to be in pairs of data. The first column for the LINES values, and the second column for the SAMPS values. Line x only contains one number.

  9. [ls2pc-same] PRINT file name and OUTFILE name are the same

    The names given in these 2 parameters are the same. Change one of the names a re-run.

  10. [ls2pc-write] Error writing to TPS file

    An error occured when attempting to write to the TPS file. Possible causes include a lack of disk space.

User Notes:

  1. File contents should be in the following format:

        line-1  sample-1
        line-2  sample-2
              .
              .
              .
        line-n  sample-n