User's Guide

INTCUT

Calculates the intersection of two polygons.

Function:

Calculates the intersection of two polygons and creates a polygon of this intersection for the two input files. The minimum and maximum line/sample locations of the output polygons are calculated, printed, and returned to the global parameters $WINDOW1 and $WINDOW2.

Parameters:

INFILE
Input files. IBIS graphics files that contain polygon coordinates.

OUTFILE
Output files. These IBIS graphics file will contain the intersection polygon coordinates of the files specified in INFILE. The coordinates of each of these files will be offset to correspond to the coordinates in corresponding file specified in INFILE.

SL(1,1)
Starting lines. This is the starting line position that the images corresponding to files specified in INFILE will have in the mosaic.

SS(1,1)
Starting samples. This is the starting sample position that the images corresponding to files specified in INFILE will have in the mosaic.

PRINT(TERM)
Output destination. The destination of the output.


  = 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> intcut infile = (cut1.dat,cut2.dat) outfile = (out1.dat,out1.dat) sl=(1,1) ss=(1,400) print = term

    CUT1.DAT and CUT2.DAT are opened and read in. Each of the line/sample coordinates in CUT1.DAT are offset by zero. Each of the line/sample coordinates in CUT2.DAT are offset by zero and 399, respectively. The intersection of these two polygons is then calculated. OUT1.DAT and OUT2.DAT are created using this intersection polygon. The minimum and maximum line/sample locations of the output polygons is calculated, returned to the global parameters $WINDOW1 and $WINDOW2, and printed to the terminal.

Description/Algorithm:

After reading the parameters, INFILE1 and INFILE2 are opened and the polygon vertices are read. Each of the line/sample coordinates in CUT1.DAT and CUT2.DAT are offset by the values found in SL and SS minus 1. The intersection of the two polygons is then calculated. A value of 1 is added to each of the vertices of this intersection polygon. SL and SS are then subtracted from vertices of the polygon in order to create OUTFILE1 and OUTFILE2. When all the processing is finished, all the files are closed and the completion message is displayed.

Nonfatal Error Message:

  1. [intcut-close] Error closing <XXXXX> file

    An error was encountered while closing the <XXXXX> file. The data may still be valid.

Fatal Error Messages:

  1. [intcut-fatal] Fatal error encountered

    A fatal error was encountered during processing. The output file may or may not be valid, and processing is terminated. The message that is displayed immediately preceding this message is the specific error that was encountered.

  2. [intcut-intersect] Two input polygons do not intersect

    The two input polygons do not intersect at all. Verify that the input polygon files are for adjoining images.

  3. [intcut-open] Cannot open <XXXXXX> file

    The <XXXXXX> file could not be opened and processing is terminated. Verify that the <XXXXXX> file exists.

  4. [intcut-overlap] Two input polygons do not overlap correctly

    Holes were found within the intersection of the two input file. Verify that the cutlines are correct.

  5. [intcut-polygon] Input polygon <X> is not closed

    The polygon has to have the same coordinates for both the beginning and ending points. Recreate the polygon with the same beginning and ending points.

  6. [intcut-read] Error reading <XXXXXX> file

    The <XXXXXX> file could not be read; and therefore, an output file cannot be created. Verify that the format of the file is correct.

  7. [intcut-write] Error writing to <XXXXXXX> file

    The <XXXXXXX> file could not be written to. Verify that disk space is available.

  8. [intcut-invalid] Invalid specification. Values of SL must be positive

    The values of SL must be positive. Respecify SL and re-run.

  9. [intcut-invalid] Invalid specification. Values of SS must be positive

    The values of SS must be positive. Respecify SS and re-run.

User Notes:

  1. The minimum and maximum line/sample locations of the output polygons is calculated and returned to the global parameters $WINDOW1 and $WINDOW2. This is done in order that an application called after INTCUT can have access to this information and use this information as input window specifications to help reduce the application's processing time.

  2. A related function is HISMTCH.