Using mosaic datasets and image services in analysis and geoprocessing
Mosaic datasets and image services can contain multiple resolutions of data; therefore, you need to consider their use when designing them and consider their content when using them.
Designing a mosaic dataset for analysis
If you're designing a mosaic dataset that will be used to perform analysis there are three important limits that can impact the use of the mosaic dataset in analysis:
- The resolution (cell size) of the data
- The limit on the request size
- The limit on the number of rasters per mosaicked image (request)
The resolution can impact the quality and validity of your analysis. For instance, if you're performing some critical or geospecific analysis with the data, then the accuracy of the result is dependent on the least accurate dataset in the collection. For example, if you had a 10-meter resolution elevation dataset and a 2-meter one, even if you resample the 10-meter dataset to 2-meters, it will not become more accurate. If you combine these two, the area covered by the datasets is only as accurate as the 10-meter dataset.
Some overviews or other low-resolution items in a mosaic dataset may incorrectly impact the resolution for analysis. In these cases, you would want to use the most appropriate resolution (not the overviews). You may also want to use raster data that has a consistent resolution, rather than mix different resolutions into a mosaic dataset. In either case, be sure to verify or set the cell size for the mosaic dataset that is appropriate for this type of analysis.
- Right-click the mosaic dataset in the Catalog window and click Properties.
- Click the General tab.
Under Raster Information is the Cell Size (X, Y) property. This is the cell size that is used when performing any analysis or processing that uses the cell size. This value defaults to the smallest cell size (LowPS) used in the mosaic dataset. For example, you may have two elevation datasets in a mosaic dataset; one covers an entire city at a resolution of 1 meter and the other covers a neighborhood at a resolution of 50 centimeters; therefore, the cell size of the mosaic dataset will be 50 centimeters. Depending on how this mosaic dataset is being used, you may want to change the mosaic dataset's cell size to be 1 meter. That way, any analysis on the entire area would use an appropriate cell size. If required, a user can specify the cell size they want when processing; therefore, if they're only using the higher-resolution dataset in an analysis, they can specify the 50-centimeter size.
- Next to the Cell Size (X, Y) property, click the Edit button.
- Enter a new cell size. Alternatively, click the Set Default button to reset the values to the original default values.
- Click OK to close each dialog box.
Alternatively, you can use the Set Mosaic Dataset Properties tool and change the value by changing the Output Cell Size parameter.
The limit on the request size will impact the size of the dataset that can be analyzed. Mosaic datasets have a maximum request size property that limits the numbers of rows and columns that can be accessed or exported. Therefore, the size of the image being processed by the geoprocessing tool may be smaller than the analysis requires. Additionally, the limit on the number of rasters that can be combined to create the mosaicked image can be exceeded in some analysis operations. This can result in an output with missing content. Both of these properties can be increased in the source mosaic dataset properties.
- Right-click the mosaic dataset in the Catalog window and click Properties.
- Click the Defaults tab.
- Enter a new value for the Maximum Size of Requests Rows and Columns properties.
- Enter a new value for the Maximum Number Of Rasters Per Mosaic.
- Click OK to close the dialog box.
Alternatively, you can use the Set Mosaic Dataset Properties tool and define new values in the Rows of Maximum Image Size Requests, Columns of Maximum Image Size of Requests, and Max Number Per Mosaic parameters.
Considerations when using mosaic datasets and image services in analysis
Mosaic datasets, and the image services published from them, can contain multiple resolutions of data and be extremely large; therefore, there are a few things you need to know to use them successfully.
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 processed by the geoprocessing tool may be smaller than required. This property can only be increased in the source mosaic dataset properties or by the server administrator, or you need to process a chunk at a time.
To change this value, see the steps above.
If you are exceeding this value, you will receive an error.
-
Mosaic datasets or image services 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, be sure to use an appropriate cell size, such as 1 kilometer.
If you have permission to modify the mosaic dataset you can use the steps above to change the Cell Size (X, Y) property; otherwise, you can specify the Cell Size parameter value in the geoprocessing environments. When you specify a cell size, then the rasters with the same cell size will be used. For areas where there are no rasters with this cell size, then the other rasters will be resampled to this cell size. If you want rasters with a different cell size to be excluded, then you should change the mosaic method to lock to the rasters only with the specific cell size; therefore, any area missing rasters with that cell size will be treated as NoData.
To determine the appropriate cell size, see the steps below.
To lock to specific rasters, see the steps below.
Note:Only the tools in the Spatial Analyst toolbox and the 3D Analyst toolbox use the Cell Size parameter value in the geoprocessing environments. For other tools, create an in-memory layer that defines the cell size, such as using the Make Mosaic Layer tool.
- Mosaic datasets or image services can contain imagery covering the earth. If you don't want all this content processed, you should limit the extent using one of the layer tools suggested below.
To reiterate: Setting the cell size and extent is very important when using geoprocessing tools.
Using tools on the toolbars
There are several interactive tools on the Spatial Analyst and 3D Analyst toolbars that analyze raster data. When the input is a mosaic dataset or image service, the cell size and extents are set to the screen resolution of the data and the display extent.
Using mosaic datasets
The raster or Spatial Analyst geoprocessing tools directly support the mosaic dataset or mosaic layer. To check if any other geoprocessing tools will support them, review the documentation for the tool. If the input data type is Raster Dataset, Raster Layer, Mosaic Layer, or Mosaic Dataset, 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, drag a mosaic layer in the ArcMap table of contents to the tool's input, or drag the mosaic dataset onto 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, 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 require your image service to 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.
Determining the cell size
To determine the cell size that you want to use in your analysis you should look at two things: what are the cell sizes represented in the mosaic dataset or image service, and are the rasters with this cell size covering the area you need to analyze.
- Add the mosaic dataset or image service to ArcMap.
- Open the attribute table and look at the values in the LowPS field.
Multiple unique LowPS values indicate that this mosaic dataset or image service contains rasters of multiple resolutions.
- Select the rasters with the LowPS cell sizes you want to use and examine their extent for your analysis.
Using specific rasters within mosaic datasets or image services
You can also use one or more raster datasets, contained within a mosaic dataset, as the input to tools. To do this in ArcMap or ArcGlobe, you must add the mosaic dataset to the table of contents, select the raster datasets with it, then add that layer to the tool. The steps are as follows:
-
Make a selection. This can be done using several methods, such as the following:
- Opening the attribute table and selecting one or more rows
- Using Select by Attribute or Select by Location from the Selection menu
- Using the Select Features tool on the Tools toolbar
- To remove any overviews from the selection set, right-click the image service layer or mosaic dataset's Footprint layer in the table of contents and click Selection > Reselect Only Primary Rasters.
- Right-click the image service layer or mosaic dataset's Footprint layer and click Selection > Lock To Selected Rasters.
- Open a geoprocessing tool and choose the layer in the input drop-down menu.
In ArcCatalog, you can select the individual raster dataset on the Contents tab and drag it onto the geoprocessing tool's input parameter.
You can also directly specify the item in the mosaic dataset by entering its object ID as follows:
<path to geodatabase>\<geodatabase>\<mosaic dataset>\raster.objectid=<objectID #>
for example, C:\temp\MyGeodatabase.gdb\MyMosaicDataset\raster.objectid=123.