Manage Map Server Cache Tiles (Server)

Summary

Creates and updates tiles in an existing web tile layer cache (in ArcGIS Enterprise or ArcGIS Online), map image layers in ArcGIS Enterprise, and cached map or image services in a stand-alone server. This tool is used to create new tiles, replace missing tiles, overwrite outdated tiles, and delete tiles.

Usage

  • This tool may take a long time to run for caches that cover a large geographic extent or very large map scales. If the tool is cancelled, tile creation is stopped, but the existing tiles are not deleted. This means you can cancel the tool if you run out of time and rerun it later on the same cache by setting the Update Mode parameter to Recreate Empty Tiles.

Parameters

LabelExplanationData Type
Input Service

The web tile layer, web imagery layer, or map image layer whose cache tiles will be updated.

Image Service; Map Server
Scales

A list of scale levels at which tiles will be created.

By default, the scales listed in the tool dialog box are between the minimum and maximum cached scales for the service. You cannot change the cache scale range of the service in ArcGIS AllSource.

Double
Update Mode

Specifies the mode that will be used to update the cache.

  • Recreate Empty TilesOnly tiles that are empty will be created. Existing tiles will be left unchanged. This option is not available for web tile layers published to ArcGIS Online.
  • Recreate All TilesExisting tiles will be replaced and new tiles will be added if the extent has changed.
  • Delete TilesTiles will be deleted from the cache. The cache folder structure will not be deleted.
String
Number of caching service instances
(Optional)
Long
Area Of Interest
(Optional)

An area of interest that will constrain where tiles will be created or deleted. This parameter is useful for managing tiles for irregularly shaped areas. It is also useful when precaching some areas and leaving less-visited areas uncached.

If you do not provide a value for this parameter, the default value uses the full extent of the map.

Feature Set
Update Extent
(Optional)

A rectangular extent used to create or delete tiles, depending on the value of the Update Mode parameter. If both the Update Extent and Area of Interest parameter values are specified, the Area of Interest value will be used.

  • Current Display Extent Map View—The extent will be based on the active map or scene. This option is only available when there is an active map.
  • Draw Extent Draw Extent—The extent will be based on a rectangle drawn on the map or scene. This option will create a feature class in the project geodatabase and add a layer to the map. The feature class will have the same coordinate system as the map.
    Note:

    This option is not available in the Environments dialog box. It is only available from a tool parameter with an extent data type or from the Environments tab on a tool dialog box.

    Note:

    When the Enable and disable editing from the Edit tab editing option is checked, you must enable editing on the Edit ribbon tab to draw the extent.

  • Extent of a Layer Layer—The extent will be based on an active map layer. Use the drop-down list to choose an available layer or use the Extent of data in all layers option to get the combined extent of all active map layers, excluding the basemap. This option is only available when there is an active map with layers.

    Each map layer has the following options:

    • All Features Select All—The extent of all features in the layer.
    • Selected Features Area from Selected Features—The extent of the selected features in the layer.
    • Visible Features Extent Indicator—The extent of the visible features in the layer.
      Note:

      The extents from the Selected Features Area from Selected Features and Visible Features Extent Indicator options are only available for feature layers.

  • Browse Browse—The extent will be based on an existing dataset.
  • Clipboard Paste—The extent can be copied to and pasted from the clipboard.
    • Copy Extent Copy—Copies the extent coordinates and coordinate system to the clipboard.
    • Use Paste Extent Paste—Pastes the extent coordinates and, optionally, the coordinate system from the clipboard. If the clipboard values do not include a coordinate system, the extent will use the map’s coordinate system.
    Note:

    The extent coordinates are copied to and pasted from the clipboard using the same formatting and order as the ArcPy Extent object: x-min, y-min, x-max, y-max, and the spatial reference.

  • Reset Extent Reset—The extent will be reset to the default value.
  • Manually entered coordinates—The coordinates must be numeric values and in the active map's coordinate system.
    Caution:

    The map may use different display units than the entered coordinates. The use of a cardinal direction (N, S, E, W) is not supported. Use a negative value sign for south and west coordinates.

Extent
Wait for job completion
(Optional)

Specifies whether the tool will continue to run while the cache job runs on ArcGIS Online or Portal for ArcGIS.

  • Checked—The tool will continue to run while the cache job runs on ArcGIS Online or Portal for ArcGIS. Using this option, you can request detailed progress reports at any time and view the geoprocessing messages as they appear. This is the default.
  • Unchecked—A job will be submitted to the portal, allowing you to perform other geoprocessing tasks in ArcGIS AllSource or close it. Use this option when you are building a cache automatically at the time you publish the service. You can also set this option on any other cache that you build.
Boolean
Portal URL
(Optional)

The URL of the portal.

String

Derived Output

LabelExplanationData Type
Output Map Service URL

The output URL.

String

arcpy.management.ManageMapServerCacheTiles(input_service, scales, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {update_extent}, {wait_for_job_completion}, {portal_url})
NameExplanationData Type
input_service

The web tile layer, web imagery layer, or map image layer whose cache tiles will be updated.

Image Service; Map Server
scales
[scales,...]

A list of scale levels at which tiles will be created.

Double
update_mode

Specifies the mode that will be used to update the cache.

  • RECREATE_EMPTY_TILESOnly tiles that are empty will be created. Existing tiles will be left unchanged. This option is not available for web tile layers published to ArcGIS Online.
  • RECREATE_ALL_TILESExisting tiles will be replaced and new tiles will be added if the extent has changed.
  • DELETE_TILESTiles will be deleted from the cache. The cache folder structure will not be deleted.
String
num_of_caching_service_instances
(Optional)
Long
area_of_interest
(Optional)

An area of interest that will constrain where tiles will be created or deleted. This parameter is useful for managing tiles for irregularly shaped areas. It is also useful when precaching some areas and leaving less-visited areas uncached.

If you do not provide a value for this parameter, the default value uses the full extent of the map.

Feature Set
update_extent
(Optional)

A rectangular extent used to create or delete tiles, depending on the value of the update_mode parameter. If both the update_extent and area_of_interest parameter values are specified, the area_of_interest value will be used.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
wait_for_job_completion
(Optional)

Specifies whether the tool will continue to run while the cache job runs on ArcGIS Online or Portal for ArcGIS.

  • WAITThe tool will continue to run while the cache job runs on ArcGIS Online or Portal for ArcGIS. Using this option, you can request detailed progress reports at any time and view the geoprocessing messages as they appear. This is the default. It is recommended that you use this option in Python scripts.
  • DO_NOT_WAITA job will be submitted to the server, allowing you to perform other geoprocessing tasks. Use this option when you are building a cache automatically at the time you publish the service. You can also set this option on any other cache that you build.
Boolean
portal_url
(Optional)

The URL of the portal.

String

Derived Output

NameExplanationData Type
out_job_url

The output URL.

String

Environments