These GridUtility methods create new GridData objects. The new grid has different extents from the input grid(s), but will retain the original grid's cell size, coordinate system, and cell values.

GridUtilities.extractSubGrid


This method creates a new grid with a smaller extent than the input grid, but with identical values and geometry to the original grid within the new extents.
If the origin or extents given as arguments fall outside the boundaries of the input grid, the method will return a null grid and set the status variable to a non-zero value.
GridData GridUtilities.extractSubGrid(
GridData inGrid,
int xOrigin,
int yOrigin,
int xExtent,
int yExtent,
int[] status)
The origin and extent are specified in row and column numbers, not in geographic coordinates. The x and y extents are the width and height (number of columns and rows) in the output grid.

GridUtilities.mosaic


This method creates a new grid with an extent large enough to cover both of the input grids, and combines the contents of the input grids. If the grids given as arguments are not compatible for purposes of mosaicking, the method will return a null grid and set the status variable to a non-zero value.
GridData GridUtilities.mosaic(
GridData inGrid1,
GridData inGrid2)
The following rules apply for calculating cell values in the output GridData object. If cell (i, j) is null in both grids, it will be null in the output. If cell (i, j) is null in one grid, but not the other, it will take the non-null value, whether it comes from inGrid1 or inGrid2. If cell (i, j) has a non-null value in both grids, the value from the first grid listed (inGrid1) will be used.