Download Rasters
- URL:https://<imageservice-url>/download
- Required Capability:Catalog, Download
- Version Introduced:10.0
Description
As of 10.5, you must license your ArcGIS Server as an ArcGIS Image Server in order to use this resource.
The Download Rasters operation is performed on an image service resource.
The Download Rasters operation 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.
You can provide arguments to the Download Rasters operation as query parameters defined in the following parameters table:
Request parameters
Parameter |
Details |
---|---|
f |
The response format. The default response format is html. Values: html | json |
rasterIds | Description: A comma-separated list of raster IDs whose files are to be downloaded. Example: 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:
Examples:
|
geometryType | Description: 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 | Description: 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. New at 10.1: 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, BIL, BSQ, BIP, ENVI, JP2, GIF, BMP, and PNG. Example: format=TIFF, format=JP2:Conversion |
Example usage
Example: Download rasters in TIFF output format, clipped to a specified envelope.
https://servername/ArcGIS/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
{
"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
{
"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
]
}
]
}