Download Rasters

URL:
https://<imageservice-url>/download
Methods:
GET
Required Capability:
Catalog, Download
Version Introduced:
10.0

Description

The download operation is performed on an image service resource and returns information (the file ID) that can be used to download the raw raster files that are associated with a specified set of rasters in the raster catalog. The file IDs returned by this operation can be used to download individual files using the Raster File resource.

Request parameters

ParameterDetails

rasterIds

A comma-separated list of raster IDs whose files are to be downloaded.

Example

Use dark colors for code blocksCopy
1
rasterIds=37, 462

geometry

Description: The geometry to apply for clipping. If specified, the selected rasters will be clipped on the server. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for envelopes, you can specify the geometry with a simple comma-separated syntax.

By default, the geometry is assumed to be in the spatial reference of the image service. You can specify a different spatial reference by using the JSON structure syntax for geometries.

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
//JSON structures
geometryType=<geometryType>&geometry={geometry}

//Envelope simple syntax
geometryType=esriGeometryEnvelope&geometry=<xmin>,<ymin>,<xmax>,<ymax>

Examples

Use dark colors for code blocksCopy
1
2
3
geometryType=esriGeometryEnvelope&geometry={xmin: -104, ymin: 35.6, xmax: -94.32, ymax: 41}

geometryType=esriGeometryEnvelope&geometry=-104,35.6,-94.32,41

geometryType

The type of geometry specified by the geometry parameter. The geometry type can be an envelope or polygon. The default geometry type is an envelope.

Values: esriGeometryPolygon | esriGeometryEnvelope

format

The format of the rasters returned. If not specified, the rasters will be in their native format. The format applies when the clip geometry is also specified, and the format will be honored only when the raster is clipped. To force the Download Rasters operation to convert source images to a different format, append :Conversion after the format string.

Valid formats include TIFF, Imagine Image, JPEG, NITF, BIL, BSQ, BIP, ENVI, JP2, GIF, BMP, and PNG.

Examples

Use dark colors for code blocksCopy
1
2
3
format=TIFF

format=JP2:Conversion

f

The response format. The default format is html .

Values: html | json | pjson

Example usage

The following is a sample request URL for the download operation that demonstrates downloading rasters in the TIFF output format, clipped to a specified envelope:

Use dark colors for code blocksCopy
1
2
https://machine.domain.com/webadaptor/rest/services/ImageServiceName/ImageServer/download?rasterIds=5,6,10,11,12&geometry={"xmin":-1949594.8286481365,
"ymin": 882737.0181116117,"xmax":-1946926.2791246006,"ymax":884828.2021675818,"spatialReference":{"wkid":102009}}&geometryType=esriGeometryEnvelope&format=TIFF&f=html

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "rasterFiles": [ //the list of files that make up the rasters to be downloaded
    { //info pertaining to a single file
      //use this ID to download the file using the Raster File resource
      "id": "<fileId1>",
      "size": <fileSize1>,
      //an array of IDs of rasters that include this file
      "rasterIds": [ <rasterId11>, <rasterId12> ]
    },
    {
      "id": "<fileId2>",
      "size": <fileSize2>,
      "rasterIds": [ <rasterId21>, <rasterId22> ]
    }
  ]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  "rasterFiles": [
    {
      "id": "https://servername/arcgisoutput/_ags_507978500/md/data/2w21w_5_s6c.tif",
      "size": 390431,
      "rasterIds": [
        5
      ]
    },
    {
      "id": "https://servername/arcgisoutput/_ags_507978500/md/data/2w21w_5_s6c.tfw",
      "size": 90,
      "rasterIds": [
        5
      ]
    },
    {
      "id": "https://servername/data/2w22w.jpg",
      "size": 1913965,
      "rasterIds": [
        6
      ]
    },
    {
      "id": "https://servername/data/2w22w.aux",
      "size": 18049,
      "rasterIds": [
        6
      ]
    },
    {
      "id": "https://servername/data/2w22w.rrd",
      "size": 2339130,
      "rasterIds": [
        6
      ]
    }
  ]
}

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