Mosaic

This tool will create an image mosaic from one or more input image files using one of three resampling methods including, nearest neighbour, bilinear interpolation, and cubic convolution.The order of the input source image files is important. Grid cells in the output image will be assigned the corresponding value determined from the first image found in the list to possess an overlapping coordinate.

The Nearest neighbour resampling approach assigns each grid cell in the destination image the value of the nearest grid cell corresponding the the same x- y- coordinates in the source images. The Bilinear resampling method interpolates a new value based on the nearest four grid cells in one of the source images. The Cubic convolution resampling method interpolates a new value based on the nearest 16 grid cells in one of the source images. Notice that only the Nearest neighbour method is appropriate with categorical data, while the other two approaches often give better results for data on a continuous scale. The Nearest neighbour method is the fastest of the three, followed by Bilinear, followed by Cubic convolution, which is comparably slow in operation.

NoData values are ignored during resampling. Notice that if the Bilinear or Cubic convolution resampling methods are selected, the destination image should be of the float data type and continuous data scale as the output will contain floating-point values (i.e. decimal numbers).

The Mosaic With Feathering tool provides superior radiometric interpolation within the area of overlap in image pairs and is therefore the preferred method of mosaicing images with extended overlapping regions.


Resample Versus Mosaic

Resample is very similar in operation to the Mosaic tool. The Resample tool should be used when there is an existing image into which you would like to dump information from one or more source images. If the source images are more extensive than the destination image, i.e. there are areas that extend beyond the destination image boundaries, these areas will not be represented in the updated image. Grid cells in the destination image that are not overlapping with any of the input source images will not be updated, i.e. they will possess the same value as before the resampling operation. The Mosaic tool is used when there is no existing destination image. In this case, a new image is created that represents the bounding rectangle of each of the two or more input images. Grid cells in the output image that do not overlap with any of the input images will be assigned the NoData value.

See Also:

Scripting:

The following is an example of a Python script using this tool:

wd = pluginHost.getWorkingDirectory()
# You may have multiple input files but they must
# be separated by semicolons in the string.
inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
outputFile = wd + "output.dep"
resamplingMethod = "nearest neighbour"
args = [inputFiles, outputFile, resamplingMethod]
pluginHost.runPlugin("Mosaic", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
// You may have multiple input files but they must
// be separated by semicolons in the string.
def inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
def outputFile = wd + "output.dep"
def resamplingMethod = "bilinear"
String[] args = [inputFiles, outputFile, resamplingMethod]
pluginHost.runPlugin("Mosaic", args, false)

Credits: