Skip to content
URL:
https://<rasteranalysistools-url>/MosaicImage
Methods:
GETPOST
Version Introduced:
10.8.1

Description

The MosaicImage operation can be used to append an existing image service to a hosted imagery layer referencing cloud raster format raster dataset. The input images must be within the extent of the target hosted imagery layer.

Request parameters

ParameterDetails

inputRasters

(Required)

Single or multiple imagery layers which will be mosaicked to the target imagery layer.

Syntax: JSON object describes the input from raster. At least one type of input needs to be provided in the JSON object. If multiple input types are given in the same JSON dictionary, the itemId takes priority.

Example:

Use dark colors for code blocksCopy
1
2
3
4
{"itemId": "<portal item id>"}
{"url": "<image service url>"}
{"itemIds": ["<portal item id>", "<portal item id>"]}
{"urls": ["<image service url>", "<image service url>"]}

targetRaster

(Required)

Specifies the target raster. The target raster can be an imagery layer item, image service URL, or a cloud raster format (CRF) raster dataset path. The source raster dataset of the image service must be cloud raster dataset format as well.

Example:

Use dark colors for code blocksCopy
1
2
3
{"itemId": "<portal item id>"}
{"url": "<image service url>"}
{"uri": "<crf raster dataset path>"}

mosaicOperator

(Optional)

Specifies the method that will be used to mosaic overlapping areas.

  • FIRST: The output cell value of the overlapping areas will be the value from the first raster dataset mosaicked into that location.
  • LAST: The output cell value of the overlapping areas will be the value from the last raster dataset mosaicked into that location. This is the default.
  • BLEND: The output cell value of the overlapping areas will be a horizontally weighted calculation of the values of the cells in the overlapping area.
  • MEAN: The output cell value of the overlapping areas will be the average value of the overlapping cells.
  • MINIMUM: The output cell value of the overlapping areas will be the minimum value of the overlapping cells.
  • MAXIMUM: The output cell value of the overlapping areas will be the maximum value of the overlapping cells.
  • SUM: The output cell value of the overlapping areas will be the total sum of the overlapping cells.

mosaicColormapMode

(Optional)

Specifies the method that will be used to choose which color map from the input rasters will be applied to the mosaic output.

  • FIRST: The color map from the first raster dataset in the list will be applied to the output raster mosaic. This is the default.
  • LAST: The color map from the last raster dataset in the list will be applied to the output raster mosaic.
  • MATCH: All the color maps will be considered when mosaicking. If all possible values are already used (for the bit depth), the tool will match the value with the closest available color.
  • REJECT: Only the raster datasets that do not have a color map associated with them will be mosaicked.

noDataValue

(Optional)

All the pixels with the specified value will be set to NoData in the output raster dataset.

context

(Optional)

Contains additional settings that affect task execution. This task has the following settings:

  • parallelProcessingFactor: The number of processes across which a tool will spread its operation.
  • resamplingMethod: choose which resampling method to use when creating the raster dataset for download.
  • NEAREST: Uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.
  • BILINEAR: Determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.
  • CUBIC: Determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for the MosaicImage operation:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/MosaicImage/submitJob?inputRasters=[{"itemId":"bdf62717a5644fee8e4b9de45d86a74f"}]&targetRaster={"itemId":"3b629d9ffa664b8ca0d7e65da8301812"}&mosaicOperator=LAST&mosaicColormapMode=FIRST&noDataValue=null&f=pjson

JSON Response example

The response returns the outputRaster output parameter, which has properties for parameter name, data type, and value. The content of the value is the output image service URL.

Use dark colors for code blocksCopy
1
2
3
4
5
{
    "paramName": "outputRaster",
    "dataType": "GPString",
    "value": "https://<server url>/arcgis/rest/services/Hosted/Hosted_mosaic_dem_image/ImageServer"
}

Response

When you submit a request, the task assigns a unique job ID for the transaction.

Syntax:

Use dark colors for code blocksCopy
1
{ "jobId": "<unique job identifier>", "jobStatus": "<job status>" }

After the initial request is submitted, you can use the jobId to periodically check the status of the job and messages, as described in Check job status. Once the job has successfully completed, use the jobId to retrieve the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
https://<raster analysis tools url>/MosaicImage/jobs/<jobId>

When the status of the job request is esriJobSucceeded , you can access the results of the analysis by making a request of the following form:

Use dark colors for code blocksCopy
1
https://<raster analysis tools url>/MosaicImage/jobs/<jobId>/results/outputRaster

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.