Skip To Content

Create Map Tile Package


Generates tiles from a map or basemap and packages the tiles to create a single compressed .tpk file.


  • The input map must have description and tags in order for the tool to execute. To add description and tags, right click the map name in the Contents pane and select Properties to enter a description in tags on the Description tab.

  • By choosing PNG for the Tiling Format parameter, the tool will automatically select the correct format (PNG8, PNG24, or PNG32) based on the specified Level of Display.


CreateMapTilePackage_management (in_map, service_type, output_file, format_type, level_of_detail, {service_file}, {summary}, {tags}, {extent})
ParameterExplanationData Type

The map from which tiles will be generated and packaged.


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

  • EXISTINGTiling 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 your server and you want to match it. Matching tiling schemes ensures that your tiles will overlay correctly in your ArcGIS Runtime application.If you choose this option, your source map document should use the same coordinate system as the map whose tiling scheme you are importing.
  • ONLINEThe ArcGIS Online/Bing Maps/Google Maps tiling scheme is used. This is the default.The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay your 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 data frame of your source map document must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system.The ArcGIS Online/Bing Maps/Google Maps tiling scheme is required if you'll be overlaying your 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 your 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 would be zoomed in too far to be of use to your map. Packaging for large scales can take up much 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, you should remove this scale level when you create the tile package.

The output map tile package.


Specifies the format of the generated tiles.

  • PNGUse PNG to automatically select the correct format (PNG 8, PNG 24, or PNG 32) based on the specified Level of Detail. This is the default.
  • PNG8Use PNG 8 for overlay services that need to have a transparent background, such as roads and boundaries. PNG 8 creates tiles of very small size on disk with no loss of information. Do not use PNG 8 if your map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and antialiasing can easily push your map over 256 colors. Even symbols such as highway shields may have subtle antialiasing around the edges that unexpectedly adds colors to your map.
  • PNG24You can use PNG 24 for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG 8).
  • PNG32Use PNG 32 for overlay services, such as roads and boundaries, that have more than 256 colors. PNG 32 is an especially good choice for overlay services that have antialiasing enabled on lines or text. PNG 32 creates larger tiles on disk than PNG 24, but the tiles are fully supported in all browsers.
  • JPEGUse this format for basemap services that have large color variation and do not need to have a transparent background. For example, raster imagery and very detailed vector basemaps tend to 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 your map contains vector linework or labels, it may produce too much noise or blurry area around the lines. If this is the case, you can attempt to raise the compression value from the default of 75. A higher value, such as 90, may balance an acceptable quality of linework with the small tile size benefit of the JPEG.It's up to you to decide what image quality you consider acceptable. If you are willing to accept a minor amount of noise in the images, you may save large amounts of disk space by choosing JPEG. The smaller tile size also means the application can download the tiles faster.
  • MIXEDA mixed package uses JPEG in the center of the package with PNG 32 on the edge of the package. Use the mixed mode when you want to cleanly overlay raster packages on other layers.When a mixed package is created, PNG 32 tiles are created anywhere that transparency is detected (in other words, anywhere that the data frame background is visible). The rest of the tiles are built using JPEG. This keeps the average file size down while providing you with a clean overlay on top of other packages. If you do not use the mixed mode package in this scenario, you will see a nontransparent collar around the periphery of your image where it overlaps the other package.

Specify the number of scale levels at which tiles will be generated for the package. Possible values are 1 through 20.


Specifies the name of the map service or the XML files to use for the tiling scheme. This parameter is required only when the service_type parameter is EXISTING.

MapServer; File

Adds summary information to the properties of the package.


Adds tag information to the properties of the package. Multiple tags can be added separated by a comma or semicolon.


Specify the extent by manually entering the coordinates in the extent parameter using the format X-Min Y-Min X-Max Y-Max. To use the extent of a specific layer, specify the layer name.

  • MAXOFUnion of inputs
  • MINOFIntersection of inputs
  • DISPLAYSame extent as current display
  • <Layer>Same extent as specified layer

Code sample

CreateMapTilePackage example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/TilePackageExample" 
arcpy.CreateMapTilePackage_management('World Soils', "ONLINE", 'Example.tpk', "PNG8", "10")
CreateMapTilePackage example 2 (stand-alone script)

Find and create map tile packages for all map documents that reside in a specified folder.

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

# import system modules
import os
import arcpy

# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Tilepackages/" 

# Loop through the project, find all the maps, and
#   create a map tile package for each map,
#   using the same name as the map
p ="c:\\temp\\myproject.aprx")
for m in p.listMaps():
    print("Packaging " +
    arcpy.CreateMapTilePackage_management(m, "ONLINE", + '.tpk', "PNG8", "10")


Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics