Create Map Tile Package (Data Management)

Summary

Generates tiles from a map and packages them as a single tile package or multiple smaller tile packages.

Usage

  • This tool honors the Parallel Processing Factor environment variable. When the Create Multiple Packages parameter is checked, parallel processing will generate cache content across multiple processes to use the available CPU and generate tile packages when the default threshold (1 GB size limit) is reached.

  • Use the Create Multiple Packages parameter when you are working with large volumes of data. With this parameter checked, multiple small tile packages will be created instead of a single large one. This allows you to generate tile content greater than 500 GB in single job and share it or upload and publish it to ArcGIS Online as a hosted tile layer. Using this approach, you can generate large tile content into small tile packages for sharing without subdividing cache extents and levels into multiple jobs.

    When this parameter is checked, you must provide a path to an empty folder on the file system in the Ouptut Folder parameter to save the output packages. You can create multipart packages only when the Package type parameter is set to tpkx and the Parallel Processing Factor environment variable is not 0.

  • When the Tiling Format parameter is set to PNG, the tool will automatically use the correct format (PNG8, PNG24, or PNG32) based on the value specified for the Maximum Level Of Detail parameter.

  • The input map must include a description and tags for the tool to run. To add a description and tags, right-click the map name in the Contents pane, and select Properties. On the Map Properties dialog box, on the Metadata tab, fill in the Tags and Description text boxes.

Parameters

LabelExplanationData Type
Input Map

The map from which tiles will be generated and packaged.

Map
Package for ArcGIS Online | Bing Maps | Google Maps

Specifies whether the tiling scheme will be generated from an existing map service or whether map tiles will be generated for ArcGIS Online, Bing Maps, and Google Maps.

  • Checked—The ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. This is the default.

    The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay cache tiles with tiles from these online mapping services. ArcGIS Desktop includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this tiling scheme, the source map must use the WGS84 Web Mercator (Auxiliary Sphere) projected coordinate system.

    The ArcGIS Online/Bing Maps/Google Maps tiling scheme is required if you'll be overlaying the package with ArcGIS Online, Bing Maps, or Google Maps. One advantage of the ArcGIS Online/Bing Maps/Google Maps tiling scheme is that it is widely known in the web mapping world, so the tiles will match those of other organizations that have used this tiling scheme. Even if you don't plan to overlay any of these well-known map services, you may choose the tiling scheme for its interoperability potential.

    The ArcGIS Online/Bing Maps/Google Maps tiling scheme may contain scales that will be zoomed in too far to be of use in your map. Packaging for large scales can take up time and disk storage space. For example, the largest scale in the tiling scheme is about 1:1,000. Packaging the entire continental United States at this scale can take weeks and require hundreds of gigabytes of storage. If you aren't prepared to package at this scale level, remove this scale level when you create the tile package.

  • Unchecked—A tiling scheme from an existing map service will be used.

    Choose this option if your organization has created a tiling scheme for an existing service on the server and you want to match it. Matching tiling schemes ensures that the tiles will overlay correctly in your Maps SDKs application.

    If you choose this option, use the same coordinate system for the source map as the map with the tiling scheme you're importing.

Boolean
Output File

The output path and file name for the map tile package. When the Create Multiple Packages parameter is checked, this parameter is replaced by the Output Folder parameter to specify where the tile packages will be generated.

File
Tiling Format

Specifies the format that will be used for the generated tiles.

  • PNGThe correct format (PNG 8, PNG 24, or PNG 32) will be used based on the specified Maximum Level Of Detail parameter value. This is the default.
  • PNG 8 bitPNG8 format will be used. Use this format for overlay services that need to have a transparent background, such as roads and boundaries. PNG8 creates tiles of very small size on disk with no loss of information. Do not use PNG8 if the map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and antialiasing can use more than 256 colors in a map. Even symbols such as highway shields may have subtle antialiasing around the edges that unexpectedly adds colors to a map.
  • PNG 24 bitPNG24 format will be used. Use this format for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG8).
  • PNG 32 bitPNG32 format will be used. Use this format for overlay services, such as roads and boundaries, that have more than 256 colors. PNG32 works well for overlay services that have antialiasing enabled on lines or text. PNG32 creates larger tiles on disk than PNG24.
  • JPEGJPEG format will be used. Use this format for basemap services that have large color variation and do not need a transparent background. For example, raster imagery and detailed vector basemaps work well with JPEG. JPEG is a lossy image format. It attempts to selectively remove data without affecting the appearance of the image. This can cause very small tile sizes on disk, but if a map contains vector line work or labels, it may produce too much noise or blurry areas around the lines. If this is the case, you can raise the compression value from the default of 75. A higher value, such as 90, may balance an acceptable quality of line work with the small tile size benefit of the JPEG.If you are willing to accept a minor amount of noise in the images, you may save large amounts of disk space with JPEG. The smaller tile size also means the application can download the tiles faster.
  • MixedJPEG format will be used in the center of the package and PNG32 will be used on the edge of the package. Use mixed mode when you want to cleanly overlay raster packages on other layers.When a mixed package is created, PNG32 tiles are created where transparency is detected (in other words, where the map background is visible). The rest of the tiles are built using JPEG. This keeps the average file size down while providing a clean overlay on top of other packages. If you do not use the mixed mode package in this scenario, a nontransparent collar around the periphery of the image where it overlaps the other package will be visible.
String
Maximum Level Of Detail

The integer representation corresponding to the number of scales used to define a cache tiling scheme. This scale value defines the maximum level up to which the cache tiles will be generated in the tile package. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from 1 to 23. The default value is 1. The maximum level of detail value must be greater than the minimum level of detail value.

Long
Service
(Optional)

The name of the map service or the .xml files that will be used for the tiling scheme. This parameter is required only when the Package for ArcGIS Online | Bing Maps | Google Maps parameter is unchecked.

Map Server; File
Summary
(Optional)

The summary information that will be added to the properties of the package.

String
Tags
(Optional)

The tag information that will be added to the properties of the package. Multiple tags can be added, separated by a comma or semicolon.

String
Extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • 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.
  • 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.
  • Browse Browse—The extent will be based on an existing dataset.
  • Intersection of Inputs Intersect—The extent will be based on the minimum or intersecting extent of all inputs. If no inputs overlap, a null extent with all zeros will result.
  • Union of Inputs Union—The extent will be based on the maximum or combined extent of all inputs.
  • 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.

    The map may be using different display units

Extent
Compression Quality
(Optional)

A value between 1 and 100 for the JPEG compression quality. The default value is 75 for JPEG tile format and zero for other formats.

Compression is supported only for JPEG and mixed formats. Choosing a higher value will result in a larger file size with a higher-quality image. Choosing a lower value will result in a smaller file size with a lower-quality image.

Long
Package type
(Optional)

Specifies the type of tile package that will be created.

  • tpkA .tpk file will be created. Tiles will be stored using Compact storage format. This format is supported across ArcGIS.
  • tpkxA .tpkx file will be created. Tiles will be stored using CompactV2 storage format, which provides better performance on network shares and cloud store directories. This package structure type is supported by newer versions of ArcGIS products such as ArcGIS Online 7.1, ArcGIS Enterprise 10.7, and ArcGIS Runtime 100.5. This is the default.
String
Minimum Level Of Detail
(Optional)

The integer representation corresponding to the number of scales used to define a cache tiling scheme. This scale value defines the level at which the cache tiles begin to be available and generated in the tile package. Possible values are from 0 to 23. The default value is 0. The minimum level of detail value must be less than or equal to the maximum level of detail value.

Long
Area of Interest
(Optional)

A feature set that constrains where tiles will be created. Use an area of interest to create tiles for irregularly shaped areas or multipart features. The areas outside the bounding box of area of interest features will not be cached. If no value is provided for this parameter, the area of interest will be the full extent of the input map.

Feature Set
Create Multiple Packages
(Optional)

Specifies whether a single large tile package or multiple small tile packages will be generated. This parameter is not available when the Parallel Processing Factor environment variable is 0 or when the Package type parameter is set to tpk.

  • Checked—Multiple tile packages (each approximately 1 GB in size) will be generated in the location defined in the Output Folder parameter.
  • Unchecked—A single tile package will be generated in the location defined in the Output File parameter. This is the default.

Boolean
Output Folder

The location where the multiple tile packages will be generated. If the output folder is not empty, a subfolder will be with created in the output folder to store the tiles. An automatically generated GUID will be used as the folder name.

When the Create Multiple Packages parameter is unchecked, this parameter is replaced by the Output File parameter to specify the name of the single tile package that will be generated.

Folder

arcpy.management.CreateMapTilePackage(in_map, service_type, output_file, format_type, level_of_detail, {service_file}, {summary}, {tags}, {extent}, {compression_quality}, {package_type}, {min_level_of_detail}, {area_of_interest}, {create_multiple_packages}, output_folder)
NameExplanationData Type
in_map

The map from which tiles will be generated and packaged.

Map
service_type

Specifies whether the tiling scheme will be generated from an existing map service or whether map tiles will be generated for ArcGIS Online, Bing Maps, and Google Maps.

  • EXISTINGA tiling scheme from an existing map service will be used. You must specify a map service in the service_file parameter.Choose this option if your organization has created a tiling scheme for an existing service on the server and you want to match it. Matching tiling schemes ensures that the tiles will overlay correctly in your Maps SDKs application.If you choose this option, use the same coordinate system for the source map as the map with the tiling scheme you're importing.
  • ONLINEThe ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. This is the default.The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay cache tiles with tiles from these online mapping services. ArcGIS Desktop includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this tiling scheme, the source map must use the WGS84 Web Mercator (Auxiliary Sphere) projected coordinate system.The ArcGIS Online/Bing Maps/Google Maps tiling scheme is required if you'll be overlaying the package with ArcGIS Online, Bing Maps, or Google Maps. One advantage of the ArcGIS Online/Bing Maps/Google Maps tiling scheme is that it is widely known in the web mapping world, so the tiles will match those of other organizations that have used this tiling scheme. Even if you don't plan to overlay any of these well-known map services, you may choose the tiling scheme for its interoperability potential.The ArcGIS Online/Bing Maps/Google Maps tiling scheme may contain scales that will be zoomed in too far to be of use in your map. Packaging for large scales can take up time and disk storage space. For example, the largest scale in the tiling scheme is about 1:1,000. Packaging the entire continental United States at this scale can take weeks and require hundreds of gigabytes of storage. If you aren't prepared to package at this scale level, remove this scale level when you create the tile package.
Boolean
output_file

The output path and file name for the map tile package.

File
format_type

Specifies the format that will be used for the generated tiles.

  • PNGThe correct format (PNG 8, PNG 24, or PNG 32) will be used based on the specified Maximum Level Of Detail parameter value. This is the default.
  • PNG8PNG8 format will be used. Use this format for overlay services that need to have a transparent background, such as roads and boundaries. PNG8 creates tiles of very small size on disk with no loss of information. Do not use PNG8 if the map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and antialiasing can use more than 256 colors in a map. Even symbols such as highway shields may have subtle antialiasing around the edges that unexpectedly adds colors to a map.
  • PNG24PNG24 format will be used. Use this format for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG8).
  • PNG32PNG32 format will be used. Use this format for overlay services, such as roads and boundaries, that have more than 256 colors. PNG32 works well for overlay services that have antialiasing enabled on lines or text. PNG32 creates larger tiles on disk than PNG24.
  • JPEGJPEG format will be used. Use this format for basemap services that have large color variation and do not need a transparent background. For example, raster imagery and detailed vector basemaps work well with JPEG. JPEG is a lossy image format. It attempts to selectively remove data without affecting the appearance of the image. This can cause very small tile sizes on disk, but if a map contains vector line work or labels, it may produce too much noise or blurry areas around the lines. If this is the case, you can raise the compression value from the default of 75. A higher value, such as 90, may balance an acceptable quality of line work with the small tile size benefit of the JPEG.If you are willing to accept a minor amount of noise in the images, you may save large amounts of disk space with JPEG. The smaller tile size also means the application can download the tiles faster.
  • MIXEDJPEG format will be used in the center of the package and PNG32 will be used on the edge of the package. Use mixed mode when you want to cleanly overlay raster packages on other layers.When a mixed package is created, PNG32 tiles are created where transparency is detected (in other words, where the map background is visible). The rest of the tiles are built using JPEG. This keeps the average file size down while providing a clean overlay on top of other packages. If you do not use the mixed mode package in this scenario, a nontransparent collar around the periphery of the image where it overlaps the other package will be visible.
String
level_of_detail

The integer representation corresponding to the number of scales used to define a cache tiling scheme. This scale value defines the maximum level up to which the cache tiles will be generated in the tile package. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from 1 to 23. The default value is 1. The maximum level of detail value must be greater than the minimum level of detail value.

Long
service_file
(Optional)

The name of the map service or the .xml files that will be used for the tiling scheme. This parameter is required only when the service_type parameter is set to EXISTING.

Map Server; File
summary
(Optional)

The summary information that will be added to the properties of the package.

String
tags
(Optional)

The tag information that will be added to the properties of the package. Multiple tags can be added, separated by a comma or semicolon.

String
extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • 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
compression_quality
(Optional)

A value between 1 and 100 for the JPEG compression quality. The default value is 75 for JPEG tile format and zero for other formats.

Compression is supported only for JPEG and mixed formats. Choosing a higher value will result in a larger file size with a higher-quality image. Choosing a lower value will result in a smaller file size with a lower-quality image.

Long
package_type
(Optional)

Specifies the type of tile package that will be created.

  • tpkA .tpk file will be created. Tiles will be stored using Compact storage format. This format is supported across ArcGIS.
  • tpkxA .tpkx file will be created. Tiles will be stored using CompactV2 storage format, which provides better performance on network shares and cloud store directories. This package structure type is supported by newer versions of ArcGIS products such as ArcGIS Online 7.1, ArcGIS Enterprise 10.7, and ArcGIS Runtime 100.5. This is the default.
String
min_level_of_detail
(Optional)

The integer representation corresponding to the number of scales used to define a cache tiling scheme. This scale value defines the level at which the cache tiles begin to be available and generated in the tile package. Possible values are from 0 to 23. The default value is 0. The minimum level of detail value must be less than or equal to the maximum level of detail value.

Long
area_of_interest
(Optional)

A feature set that constrains where tiles will be created. Use an area of interest to create tiles for irregularly shaped areas or multipart features. The areas outside the bounding box of area of interest features will not be cached. If no value is provided for this parameter, the area of interest will be the full extent of the input map.

Feature Set
create_multiple_packages
(Optional)

Specifies whether a single large tile package or multiple small tile packages will be generated. This parameter is not available when the parallelProcessingFactor environment variable is 0 or when the package_type parameter is set to tpk.

  • CREATE_MULTIPLE_PACKAGESMultiple tile packages (each approximately 1 GB in size) will be generated in the location defined in the output_folder parameter.
  • CREATE_SINGLE_PACKAGEA single tile package will be generated in the location defined in the output_file parameter. This is the default.
Boolean
output_folder

The output folder where the multiple tile packages will be generated. If the output folder is not empty, a subfolder will be with created in the output folder to store the tiles. An automatically generated GUID will be used as the folder name.

Folder

Code sample

CreateMapTilePackage example 1 (Python window)

The following Python script demonstrates how to use the CreateMapTilePackage function from the Python window.

import arcpy
arcpy.env.workspace = r"C:\Data\MinMaxLOD\states73K"
aprx = arcpy.mp.ArcGISProject(r"C:\Data\MinMaxLOD\states73K\states73K_1.aprx")
map1 = aprx.listMaps()[0]
arcpy.management.CreateMapTilePackage(map1, "ONLINE", "Example.tpkx", "PNG", "5")
CreateMapTilePackage example 2 (stand-alone script)

Find all the maps in the project and create a single map tile package for each map.

# Name: CreateMapTilePackage.py
# Description: Find all the maps in the project and
#   create a single map tile package for each map

# import system modules
import os
import arcpy

# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\Data\MinMaxLOD\states73K"

# Loop through the project, find all the maps, and
#   create a single map tile package for each map,
#   using the same name as the map
p = arcpy.mp.ArcGISProject("c:\\temp\\myproject.aprx")
extent = ""
aoi = ""

for m in p.listMaps():
    print("Packaging " + m.name)
    arcpy.management.CreateMapTilePackage(m, "ONLINE", "{}.tpkx".format(m.name), 
                                            "PNG", 9, None, "MapSummary", "MapTag", extent, "", "tpkx", 5, aoi)
CreateMapTilePackage example 3 (stand-alone script)

Create multiple map tile packages for a given map.

# Name: CreateMapTilePackage.py
# Description: Create multiple map tile packages for a given map

# import system modules
import os
import arcpy

# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\Data\MinMaxLOD\states73K"

# Create multiple map tile packages for given map,

aprx = arcpy.mp.ArcGISProject("c:\\temp\\myproject.aprx")
map1 = aprx.listMaps()[0]
extent = ""
aoi = ""
createMultiplePackages = "create_multiple_packages"
outputFolder = r"C:\11\multi"

arcpy.management.CreateMapTilePackage(map1, "ONLINE", "", "PNG", 9, None, "MapSummary", "MapTag",
                                      extent, "", "tpkx", 5, aoi,createMultiplePackages, outputFolder )

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics