FRAMES | NO FRAMES Description | Parameters | Examples | Response
Add Rasters (Operation)
URL http://<imageservice-url>/add (POST only)
Parent Resource Image Service
Required Capability Edit

Description

This operation is supported from 10.1 onwards.

The add rasters operation is performed on an image service resource.

The add rasters operation adds new rasters to an image service (POST only).

The added rasters can either be items uploaded using the itemIds parameter, or published services using the serviceUrl parameter.

If the itemIds is specified, uploaded rasters will be copied to image service's dynamic image workspace location; if the serviceUrl is specified, the image service will add this URL to the mosaic dataset with no raster files copied. The serviceUrl is required input for the following raster types: Image Service, Map Service, WCS, WMS.

You can provide arguments to the add rasters operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
itemIds Description: The upload items (raster files) to be added. Either itemIds or serviceUrl is needed to perform this operation.

Syntax: itemIds=<itemId1>,<itemId2>

Example: itemIds=ib740c7bb-e5d0-4156-9cea-12fa7d3a472c,ib740c7bb-e2d0-4106-9fea-12fa7d3a482c

serviceUrl Description: The URL of the service to be added. The image service will add this URL to the mosaic dataset. Either itemIds or serviceUrl is needed to perform this operation. Service url is required for the following raster types: Image Service, Map Service, WCS and WMS.

Example: serviceUrl=http://myserver/arcgis/services/Portland/ImageServer
rasterType Required
Description: The type of raster files being added. Raster types define the metadata and processing template for raster files to be added. Allowed values are listed in image service resource. A comprehensive coverage on description of each raster type can be found on the ArcGIS Resource Center.

Example: Raster Dataset | CADRG/ECRG | CIB | DTED | Image Service | Map Service | NITF | WCS | WMS
computeStatistics Description: If true, statistics for the rasters will be computed. The default is false.

Values: false | true
buildPyramids Description: If true, build pyramids for the rasters. The default is false.

Values: false | true
buildThumbnail Description: If true, generate a thumbnail for the rasters. The default is false.

Values: false | true
minimumCellSizeFactor Description: The factor (times raster resolution) used to populate MinPS field (maximum cell size above which raster is visible).

Syntax: minimumCellSizeFactor=<minimumCellSizeFactor>

Example: minimumCellSizeFactor=0.1
maximumCellSizeFactor Description: The factor (times raster resolution) used to populate MaxPS field (maximum cell size below which raster is visible).

Syntax: maximumCellSizeFactor=<maximumCellSizeFactor>

Example: maximumCellSizeFactor=10
attributes Description: Any attribute for the added rasters.

Syntax:
{
  "<name1>" : <value1>,
  "<name2>" : <value2>

}


Example:
{
  "MinPS": 0,
  "MaxPS": 20;
  "Year" : 2002,
  "State" : "Florida"
}
geodataTransforms Description: The geodata transformations applied on the added rasters. A geodata transformation is a mathematical model that performs geometric transformation on a raster, it defines how the pixels will be transformed when displayed or accessed, such as polynomial, projective or identity transformations. The geodata transformations will be applied to the dataset added. Below is the JSON representation of transformations:

Syntax:
[
  {
  "geodataTransform" : "<geodataTransformName1>",
  "geodataTransformArguments" : {<geodataTransformArguments1>}
  },
  {
  "geodataTransform" : "<geodataTransformName2>",
  "geodataTransformArguments" : {<geodataTransformArguments2>}
  }
]


The syntax of the geodataTransformArguments property varies based on the specified geodataTransform name. Please refer to the Geodata Transformations documentation for more details.
geodataTransformApplyMethod Description: This parameter defines how to apply the provided geodataTransform. The default is esriGeodataTransformApplyAppend.

Values: esriGeodataTransformApplyAppend | esriGeodataTransformApplyReplace | esriGeodataTransformApplyOverwrite

Example Usage

Add two jpeg2000 images to an image service through http://myserver/arcgis/rest/sampleImage/ImageServer/add, post content:
itemIds=i9d41856c-3636-4580-b796-7091cc069afb,i00ffedac-6b57-4afa-91b4-b74592c26192&rasterType=Raster Dataset&maximumCellSizeFactor=10&f=json
Add one jpeg with polynomial transformation to an image service through http://myserver/arcgis/rest/sampleImage/ImageServer/add, post request content:
itemIds=i9d41856c-3636-4580-b796-7091cc069afb&rasterType=Raster Dataset&maximumCellSizeFactor=10&geodataTransforms=

[{"geodataTransform" : "Polynomial","geodataTransformArguments" : {"sourcePoints" : [{"x":0, "y":0}, {"x":100, "y":0},{"x":100, "y":100}],
"targetPoints" : [{"x":10, "y":10}, {"x":110, "y":10},{"x":110, "y":110}],"polynomialOrder" : 1,"spatialReference": {"wkid" : 54004}}}]
&geodataTransformApplyMethod=esriGeodataTransformApplyAppend&f=json

JSON Response Syntax

{
  "addResults" : [
    {
      "rasterId" : <rasterId1>,
      "success" : <true | false>,
      "error" : { //only if success is false
            "code" : <code1>,
            "description" : "",
       }    
    },
    {
      "rasterId" : <rasterId2>,
      "success" : <true | false>,
      "error" : { //only if success is false
            "code" : <code1>,
            "description" : "",
       }
    }
  ]
}

JSON Response Example

{"addResults": [
 {
  "rasterId": 13,
  "success": true
 },
 {
  "rasterId": 14,
  "success": true
 }
]}