Export Tiles

Description

The exportTiles operation is performed as an asynchronous task and allows client applications to download map tiles from server for offline use. This operation is performed on a Image Service that allows clients to export cache tiles. The result of this operation is Image Service Job. This job response contains reference to Image Service Result resource that returns the url to resulting tile package (.tpk) or a cache raster dataset.

exportTilescan be enabled in a service by using ArcGIS Desktop or the ArcGIS Server Administrative Site Directory. In ArcGIS Desktop, make an admin or publisher connection to the server, go to service properties and enable "Allow Clients to Export Cache Tiles" in advanced caching page of the Service Editor. You can also specify the maximum tiles clients will be allowed to download. The default maximum allowed tile count is 100,000. To enable this capability using the ArcGIS Servers Administrative Site Directory, edit the service and set the properties exportTilesAllowed=true and maxExportTilesCount=100000.

At 10.2.2, exportTiles is supported as an operation of the Image Server. The use of exportTiles/submitJob operation is deprectated.

You can provide arguments to the exportTiles submitJob operation as defined in the following parameters table:

Request Parameters

Parameter

Details

f

Description: The response format. The default response format is html.

Values: html | json

tilePackage

Description: Allows exporting either a tile package or a cache raster data set. If the value is true output will be in tile package format and if the value is false Cache Raster data set is returned. The default value is false

Values: true | false

exportExtent

Description: The extent (bounding box) of the tile package or the cache dataset to be exported. If extent does not include a spatial reference, the extent values are assumed to be in the spatial reference of the map. The default value is full extent of the tiled map service.

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

Example 1: -104,35.6,-94.32,41

Example 2: {"xmin" : -109.55, "ymin" : 25.76, "xmax" : -86.39, "ymax" : 49.94,"spatialReference" : {"wkid" : 4326}}

optimizeTilesForSize

Description: (Optional) Use this parameter to enable compression of JPEG tiles and reduce the size of the downloaded tile package or the cache raster data set. Compressing tiles slightly compromises on the quality of tiles but helps reduce the size of the download. Try out sample compressions to determine the optimal compression before using this feature.

Values: true | false

compressionQuality

Description: (Optional) When optimizeTilesForSize=true you can specify a compression factor. The value must be between 0 and 100.

NoteNote:

The value cannot be greater than the default compression already set on the original tile. For example, if the default value is 75, the value of compressionQuality must be between 0 and 75. A value greater than 75 in this example will attempt to up sample an already compressed tile and will further degrade the quality of tiles.

exportBy

Description: The criteria that will be used to select the tile service levels to export. The values can be Level IDs, cache scales or the Resolution (in the case of image services).

Values: LevelID | Resolution | Scale

levels

Description: Specify the tiled service levels to export. The values should correspond to Level IDs, cache scales or the Resolution as specified in exportBy parameter. The values can be comma separated values or a range.

NoteNote:

Make sure tiles are present at the levels where you attempt to export tiles.

Example 1: 1,2,3,4,5,6,7,8,9

Example 2: 1-4,7-9

areaOfInterest

Description: (Optional) The areaOfInterest polygon allows exporting tiles within the specified polygon areas. This parameter supersedes exportExtent parameter.

Example: { "features": [{"geometry":{"rings":[[[-100,35],[-100,45],[-90,45],[-90,35],[-100,35]]],"spatialReference":{"wkid":4326}}}]}

Example Usage

Example 1:

http://serverurl/arcgis/rest/services/World_Imagery/ImageServer/exportTiles?tilePackage=true&exportExtent=&optimizeTilesForSize=false&compressionQuality=90&exportBy=levelId&levels=0-7&areaOfInterest=&f=json

Example 2:

http://serverurl/arcgis/rest/services/World_Imagery/ImageServer/exportTiles?tilePackage=true&exportExtent=-13051380,4030276,-13037288,4041136&optimizeTilesForSize=true&compressionQuality=60&exportBy=levelId&levels=13-19&areaOfInterest=&f=json

Example 3:

http://serverurl/arcgis/rest/services/World_Imagery/ImageServer/exportTiles?tilePackage=true&exportExtent=&optimizeTilesForSize=true&compressionQuality=60&exportBy=levelId&levels=13-19&areaOfInterest={ "features": [{"geometry":{"rings":[[[-100,35],[-100,45],[-90,45],[-90,35],[-100,35]]],"spatialReference":{"wkid":4326}}}]}&f=json

JSON Response Syntax

{"jobId" : "<jobId>","jobStatus" : "<jobStatus>"}

JSON Response Example

{
 "jobId": "jeeb938cbb2774269a7ca9910df4ee700",
 "jobStatus": "esriJobSubmitted"
}

10/6/2017