Using mosaic datasets and image services in geoprocessing tools

Mosaic datasets and image services can be used as the input in geoprocessing tools; however, there are a few things you need to know to use them successfully.

  1. Mosaic datasets and image services have a maximum request size property that limits the numbers of rows and columns that can be exported. Therefore, the size of the image being processed by the geoprocessing tool may be smaller than desired. This property can be increased in the source mosaic dataset properties or by the server administrator, or you need to process a 'chunk' at a time.
  2. Mosaic datasets or image service can contain images with different cell sizes. If the requested cell size is not defined in the environments, the tools will always process the mosaic dataset or image service using its base cell size (cell size defined in the dataset's properties). If you are processing the whole world, a 1 centimeter cell size may be too small and will take too long. Instead, increase your size to something larger, such as 1 kilometer.
  3. Mosaic datasets or image services can contain imagery covering the earth. If you don't want all this content processed then you should limit the extent using one of the layer tools suggested below.

Using mosaic datasets

The raster or Spatial Analysis geoprocessing tools directly support the mosaic dataset or mosaic layer. To check if any other geoprocessing tools will, review the documentation for the tool. If the input data type is Raster Dataset, Raster Layer, Mosaic Layer, or Mosaic Dataset, then you can use a mosaic dataset or mosaic layer. This means you can either directly specify a path to the mosaic dataset as input of the tool, or drag a mosaic layer in ArcMap's table of contents to the tool's input.

If scripting with Python, you can specify the input with the physical path to the mosaic dataset, or use the Make Mosaic Layer tool to create an in-memory mosaic layer first, and then set the input with the in-memory layer name.

Using image services

There are two ways to use an image service in a geoprocessing tool, but both center around the fact that your image service must be a layer to use it in the tool. This is because there are many settings that can affect an image service. If you try, you will discover that the image service cannot be dragged to the tool's input directly from the server connection.

Like earlier, you can add the image service to ArcMap and use the layer created in the table of contents. First, add the image service to your map, then open the tool. This way the layer is recognized as a valid input type and becomes selectable from the tool's input drop-down list. It can also be selected in the integrated Python window just like a normal raster layer.

The second way to use the image service in a geoprocessing tool is through the Make Image Server Layer tool. This creates a temporary raster layer from an image service that can be used as input for geoprocessing tools that support the raster layer input type.

The Make Image Server Layer tool takes the image service URL as input, and it also has additional settings to define the output layer's extent, band number, and mosaic methods. Remember, that the size of the output layer is also limited by the request size property of the image service.