- URL:https://Image Service/exportTiles
- Version Introduced:10.2.1
Description
The exportTiles operation is performed as an asynchronous task and allows client applications to download map tiles from the server for offline use. This operation is performed on an image service that allows clients to export cache tiles. The result of this operation is an image service job. This job response contains reference to the image service result resource that returns the URL to the resulting tile package (.tpk/.tpkx) or a cache raster dataset. For more information on the properties returned in the job response, see GP Job.
Note:
Support for tile packages with the file extension of .tpkx was introduced at ArcGIS Enterprise 10.7.
The exportTiles operation can be enabled in a service by using ArcGIS Pro or the ArcGIS Server Administrative Site Directory. In ArcGIS Pro, make an admin or publisher connection to the server, go to the service properties, and select the option to Allow Clients to Export Cache Tiles on the advanced caching page of the Service Editor. You can also specify the maximum number of tiles clients will be allowed to download. The default maximum allowed tile count is 100,000. To enable this capability using the ArcGIS Server Administrative Site Directory, edit the service and set the exportTilesAllowed property as true and the maxExportTilesCount property as 100000.
Legacy:
At 10.2.2, exportTiles is supported as an operation of ArcGIS Image Server. The use of the submitJob operation from exportTiles is deprecated.
Request parameters
Parameter | Details |
---|---|
storageFormatType | Introduced at 10.7. When set to esriMapCacheStorageModeCompactV2, the resulting tile package will use the .tpkx file extension. If the value is set to esriMapCacheStorageModeCompact, a tile package with the .tpk extension is generated. Values: esriMapCacheStorageModeCompactV2 | esriMapCacheStorageModeCompact |
tilePackage | Allows exporting either a tile package or a cache raster dataset. If the value is true, the output will be in tile package format, and if the value is false, a cache raster dataset is returned. The default value is false. Values: true | false |
exportExtent | The extent (bounding box) of the tile package or the cache dataset to be exported. If the 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 the full extent of the tiled map service. Syntax
Example
|
optimizeTilesForSize (Optional) | Use this parameter to enable compression of JPEG tiles and reduce the size of the downloaded tile package or the cache raster dataset. Compressing tiles slightly compromises on the quality of tiles but helps reduce the size of the download. Try sample compressions to determine the optimal compression before using this feature. Values: true | false |
compressionQuality (Optional) | This parameter can be used when optimizeTilesForSize is true. The value must be between 0 and 100. Note: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 upsample an already compressed tile and will further degrade the quality of tiles. |
exportBy | 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 | Specify the tiled service levels to export. The values should correspond to Level IDs, cache scales, or the resolution as specified in the exportBy parameter. The values can be comma-separated values or a range. Note:Make sure tiles are present at the levels where you attempt to export tiles. Example
|
areaOfInterest (Optional) | The areaOfInterest polygon allows exporting tiles within the specified polygon areas. This parameter supersedes the exportExtent parameter. Example
|
f | The response format. The default response format is html. Values: html | json | pjson |
Example usage
Example one
https://machine.domain.com/webadaptor/rest/services/World_Imagery/ImageServer/exportTiles?tilePackage=true&exportExtent=&optimizeTilesForSize=true&compressionQuality=90&exportBy=levelId&levels=0-7&areaOfInterest=&f=json
Example two
https://machine.domain.com/webadaptor/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 three
https://machine.domain.com/webadaptor/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"
}