FRAMES | NO FRAMES Description | Parameters | Examples | Response
Export Image (Operation)
URL http://<imageservice-url>/exportImage
Parent Resource Image Service
Required Capability Image

Description

The export image operation is performed on an image service resource. The result of this operation is an image resource. This resource provides information about the exported image, such as its URL, its width and height, and extent.

Apart from the usual response formats of html and json, users can also request a format called image while performing this operation. When users perform an export with the format of image, the server responds by directly streaming the image bytes to the client. With this approach you don't get any information associated with the exported image besides the actual image.

The mosaicProperties and viewpointProperties parameters were deprecated at 10 and not supported from 10.1 onwards. The mosaicRule parameter was added at 10. Users should use this new parameter instead of the former 2.

Support for the time and renderingRule parameters was added at 10.

Support for a new jpgpng format was also added at 10. jpgpng is the new default output format for Image Service export operation.

Users can provide arguments to the export image operation as query parameters. These parameters include the request extent, size information, interpolation, pixel type, and so on. The parameter details are provided in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html. If the format is image, the image bytes are directly streamed to the client.

Values: html | json | image | kmz
bbox Description: The extent (bounding box) of the exported image. Unless the bboxSR parameter has been specified, the bbox is assumed to be in the spatial reference of the image service.

Syntax: <xmin>, <ymin>, <xmax>, <ymax>

Example: bbox=-104,35.6,-94.32,41


The bboxcoordinates should always use a period as the decimal separator even in countries where traditionally a comma is used.
size Description: The size (width * height) of the exported image in pixels. If the size is not specified, an image with a default size of 400 * 400 will be exported.

Syntax: <width>, <height>

Examplesize=600,550
imageSR Description: The spatial reference of the exported image.

The spatial reference can be specified as either a well-known ID or as a spatial reference json object.

If the imageSR is not specified, the image will be exported in the spatial reference of the image service.
bboxSR Description: The spatial reference of the bbox.

The spatial reference can be specified as either a well-known ID or as a spatial reference json object.

If the bboxSR is not specified, the bbox is assumed to be in the spatial reference of the image service.
time Description: The time instant or the time extent of the exported image.

Time instant

Syntax: time=<timeInstant>
Example: time=1199145600000 (1 Jan 2008 00:00:00 GMT)

Time extent (For time extents one of <startTime> or <endTime> could be 'null').

Syntax: time=<startTime>, <endTime>
Example: time=1199145600000, 1230768000000 (1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT
A null value specified for start time or end time will represent infinity for start or end time respectively.
format Description: The format of the exported image. The default format is jpgpng.


Values: jpgpng | png | png8 | png24 | jpg | bmp | gif | tiff

Note that support for the jpgpng format was added at 10. This format returns a JPG if there are no transparent pixels in the requested extent, otherwise it returns a PNG.
pixelType The pixel type, also known as data type, pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals.

Values: C128 | C64 | F32 | F64 | S16 | S32 | S8 | U1 | U16 | U2 | U32 | U4 | U8 | UNKNOWN
noData The pixel or RGB color value representing no information.

Example 1noData=0
//pixel is transparent when pixe value of any band is 0. Example 2noData=58,128,187 //newly added at 10.0 SP2. When a RGB color value is set as nodata, a pixel with matching color will be rendered transparent.
noDataInterpretation //Added in 10.1

Interpretation of noData setting. Default is esriNoDataMatchAny when noData is a number, and esriNoDataMatchAll when noData is an array
Values: esriNoDataMatchAny | esriNoDataMatchAll

Example 1noData=0&noDataInterpretation=esriNoDataMatchAll
pixel is transparent only if the pixel value is 0 for ALL bands.

Example 2noData=58,128,187&noDataInterpretation=esriNoDataMatchAll //pixel is transparent when the pixel value is 58,128,187. Equivalent of noData=58,128,187
interpolation The resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space.

Values: RSP_BilinearInterpolation | RSP_CubicConvolution | RSP_Majority | RSP_NearestNeighbor
compressionQuality Controls how much loss the image will be subjected to by the compression algorithm. Valid value ranges of compression quality are from 0 to 100.

ExamplecompressionQuality=75
bandIds If there are multiple bands, you can specify a single band to export, or you can change the band combination (red, green, blue) by specifying the band number. Band number is 0 based.

ExamplebandIds=2,1,0
mosaicRule Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. When mosaic rule is not specified, mosaic rule will default to esriMosaicNone.

Syntax:
{
  "mosaicMethod" : "<esriMosaicNone | esriMosaicCenter | esriMosaicNadir | esriMosaicViewpoint | 
                     esriMosaicAttribute | esriMosaicLockRaster | esriMosaicNorthwest | esriMosaicSeamline>",
  "where" : "<where>",
  "sortField" : "<sortFieldName>",
  "sortValue" : <sortValue>,
  "ascending" : <true | false>,
  "lockRasterIds" : [<rasterId1>, <rasterId2>],
  "viewpoint" : <point>,
  "fids" : [<fid1>, <fid2>],
  "mosaicOperation" : "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND>"
}
Example:
{
  "mosaicMethod" : "esriMosaicLockRaster",
  "lockRasterIds" : [32, 454, 14]
}
renderingRule Specifies the rendering rule for how the requested image should be rendered.

Syntax:
{
  "rasterFunction" : "<rasterFunctionName>",
  "rasterFunctionArguments" : {<rasterFunctionArguments>},
  //optional parameter. For information on default 'variableNames', check the Raster Functions documentation for details. 
  "variableName" : "<variableName>"
}

The syntax of the rasterFunctionArguments property varies based on the specified rasterFunction name. Please refer to the Raster Functions documentation for more details.

Example Usage

Example 1: Export an image with the bounding box [[-117, 34] - [-116, 35]] in WGS 84 (4326).

http://myserver/arcgis/rest/services/MyImage/ImageServer/exportImage?bbox=-117,34,-116,35&bboxSR=4326

Example 2: Export the image similar to Example 1 but request the image in Web Mercator (102113).

http://myserver/arcgis/rest/services/MyImage/ImageServer/exportImage?bbox=-117,34,-116,35&bboxSR=4326&imageSR=102113

JSON Response Syntax

{
"href" : "<href>",
"width" : <width>,
"height" : <height>,
"extent" : {<envelope>}
}

JSON Response Example

{
"href" : "http://atlantic/arcgisoutput/_ags_map42ef5eae899942a9b564138e184a55c9.png",
"width" : 400,
"height" : 400,
"extent" : {
"xmin" : -109.55, "ymin" : 25.76, "xmax" : -86.39, "ymax" : 49.94,
"spatialReference" : {"wkid" : 4326}
}
}