Boolean Operations

Use the Grid and Image > Utilities > Boolean Operations menu option (GRIDBOOL GX) to mask one grid against another to produce a new output grid.

Boolean Operations dialog options

Input grid file 1

File name of the first grid.

Script Parameter: GRIDBOOL.GRD1

Input grid file 2

File name of the second grid.

Script Parameter: GRIDBOOL.GRD2

Output grid

File name for the output grid.

Script Parameter: GRIDBOOL.OUT

Boolean logic option

Boolean logic option for masking (default = AND).

Script Parameter: GRIDBOOL.BOOL

Size of output grid

Option controlling size of output grid area (default = minimum)

Script Parameter: GRIDBOOL.SIZ

Grid values used in overlap areas

Option controlling values to use in overlapping areas (default = Grid 1 only).

Script Parameter: GRIDBOOL.OLAP

Application Notes

Applies Boolean functions between two input grids to produce a combined output grid. The Boolean operations are based on the presence or absence of a dummy value at a grid point.

The .BOOL option can be "AND", "OR" , or "XOR" (Default = AND):

AND

Output grid is valid only in the region where the two input grids overlap.

OR

Output grid is valid in the region where either of the input grids are non-dummy.

XOR

Output grid is dummied in the region where the two input grids overlap.

The .SIZ option can be "Minimum", "Same as Grid 1", "Same as Grid 2", or "Maximum" (Default = Minimum):

Minimum

Output grid is sized exactly to the region where the two input grids overlap.

Same as Grid 1

Output grid is same size as input grid 1.

Same as Grid 2

Output grid is same size as input grid 2.

Maximum

Output grid is the largest combined area of both input grids. (Minimum coordinates are the minimum of the input grids, and maximum coordinates are the maximum of the input grids.)

The .OLAP option can be "Average", "Grid 1 only", or "Grid 2 only" (Default = Grid 1 only):

Average

Regions of overlap use the average of non-dummy values in grids 1and 2. If one of the two values is dummy, then the non-dummy is used.

Grid 1 only

Values in grid 1 only are used in regions of overlap.

Grid 2 only

Values in grid 2 only are used in regions of overlap.

Examples of Applications:

  1. It can be sued to replace dummy values in a filled grid in order to match the valid area of an original grid (i.e., as used by MAGMAP in the final stage of processing to remove filled areas from a processed grid).
  2. It can also be used to show the overlapping parts of two grids.
  3. With the averaging function, it can be used to merge two overlapping grids into a single grid.

Handling Different Projections, Cell Sizes, Origins, and Offsets

As of v6.0, the two grids need not share the same projections, origins or cell sizes. If differences in these parameters are found, then the second grid will be re-projected and interpolated to match the values of the first grid. In such cases the output grid will always have origin coordinates which are integral multiples of the cell size, in both X and Y. (In such cases, if the origin coordinates of the first grid are not integral multiples of the cell sizes, it too is interpolated to the output locations before the BOOL operation. HOWEVER, if the two grids share the same projections and cells sizes, and both have the same "shift" of cell boundaries in X and Y, then the output grid will share the shift, and no re-interpolation or inheritance of the grids prior to booling will be performed.)