- URL:
- https://<imageservice-url>/exportImage
- Methods:
GET
- Required Capability:
- Image
- Version Introduced:
- 9.3
Description
The export
operation is performed on an image service resource and results in an image resource. This resource provides information about the exported image, such as its URL, extent, width, and height.
In addition to the usual response formats of HTML and JSON, you can also request the image
format while performing this operation. When you perform an export with the image
format, 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 other than the image itself.
You 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.
Request parameters
Parameter | Details |
---|---|
| The extent (bounding box) of the exported image. Unless the Syntax
Example
|
| The size (width and height) of the exported image in pixels. If Syntax
Example
|
| This parameter indicates whether to adjust the aspect ratio or not. By default, Values: |
| The spatial reference of the exported image. The spatial reference can be specified as either a well-known ID or a spatial reference JSON object. If the |
| The spatial reference of the |
| The time instant or the time extent of the exported image. For time extents, either the Syntax
Example
|
| The format of the exported image. The default format is Values: |
| The version of the LERC format if the user sets the format as Values: |
| 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. The The processing result of the first step has a default Leave Values: |
| The pixel value representing no information. Example
|
| Interpretation of the Values: Example
|
| The resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space. Values: |
| Controls how to compress the image when exporting to TIFF format: None, JPEG, or LZ77. It does not control compression on other formats. For other output image formats (such as JPEG, PNG, PNG24, PNG32, and GIF), compressions are automatically set by the format. Example
|
| 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. The compression quality works for the JPEG format, JPGPNG (if the result is a JPG), and TIFF with JPEG compression. Example
|
| Controls the tolerance of the lerc compression algorithm. The tolerance defines the maximum possible error of pixel values in the compressed image. It's a double value. The compression tolerance works for the LERC format only. Example
|
| 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. Example
|
| Specifies the mosaic rule when defining how individual images should be mosaicked. When a mosaic rule is not specified, the default mosaic rule of the image service will be used (as advertised in the root resource: |
| Specifies the rendering rule for how the requested image should be rendered. Refer to the raster function JSON objects for the syntax and examples. |
| Added at 10.8.1 and available if the image service uses This parameter is for image services of multidimensional datasets only. The image export operation will be processed for the selected dimensional slice. The |
| The response format. The default response format is HTML. If the format is Values: |
Example usage
Example one
The following is a sample request URL that demonstrates how to export an image with a bounding box (example below) in WGS 84 (4326) and an image response format:
https://machine.domain.com/webadaptor/rest/services/World/MODIS/ImageServer/exportImage?f=image&bbox=-141.19530416221985,-62.217823180545146,139.27427961579508,84.15317625109763&imageSR=4326&bboxSR=4326&size=937,489
Below is the example values used for the bbox
parameter in the request above:
bbox=
bbox=[[-141.19530416221985,-62.217823180545146]-[139.27427961579508,84.15317625109763]]
Example two
The following is a sample request URL that demonstrates how to export an image, similar to Example 1, but instead requests the image in Web Mercator (3857) with a JSON response format:
https://machine.domain.com/webadaptor/rest/services/World/MODIS/ImageServer/exportImage?f=json&bbox=-141.19530416221985,-62.217823180545146,139.27427961579508,84.15317625109763&imageSR=3857&bboxSR=4326&size=937,489
Example three
The following is a sample request URL that demonstrates how to export an image by specifying a mosaic rule supported by the image service. The result of this request shows world temperatures during August of 1950 using only the eighth raster.
https://machine.domain.com/webadaptor/rest/services/World/Temperature/ImageServer/exportImage?bbox=-180,-55.5,180,83.5&bboxSR=&size=&imageSR=&time=&format=jpgpng&pixelType=U8&noData=&interpolation=RSP_NearestNeighbor&compressionQuality=&bandIds=&mosaicRule={"mosaicMethod" : "esriMosaicLockRaster","lockRasterIds":[8]}&renderingRule=&f=image
Example four
The following is a sample request URL that demonstrates how to export an image by specifying a rendering rule supported by the image service.
https://machine.domain.com/webadaptor/rest/services/CharlotteLAS/ImageServer/exportImage?bbox=1440000.0,535000.0,1455000.0,550000.0&bboxSR=&size=400,400&imageSR=&format=jpgpng&pixelType=UNKNOWN&noData=&interpolation=RSP_BilinearInterpolation&mosaicRule=&renderingRule={"rasterFunction" : "RFTAspectColor"}&f=image
JSON Response syntax
{
"href": "<href>",
"width": <width>,
"height": <height>,
"extent": {<envelope>}
}
JSON Response example
{
"href": "https://machine.domain.com/arcgisoutput/_ags_321611040.jpg",
"width": 937,
"height": 489,
"extent": {
"xmin": -26821417.0684016,
"ymin": -8910977.94571736,
"xmax": 26607569.5940922,
"ymax": 18972452.6604293,
"spatialReference": {"wkid" : 3857}
},
"scale": 0
}