Create Vector Tile Package (Data Management)

Summary

Generates vector tiles from a map or basemap and packages the tiles in a single .vtpk file.

Usage

  • The input map must have a description and tags for the tool to run. To add description and tags, right-click the map name in the Contents pane and click Properties. On the Metadata tab, provide a description and tags for the map.

  • Some symbology cannot be resolved in the tile creation process. Avoid symbolizing layers with hatched or gradient fills, markers along lines or polygon outlines, or most symbol effects. The only symbol effects that will be honored in the output tiles are the Move effect (often used to mimic drop-shadow effects on building features), the Offset effect, and the Dash effect. Complex dash patterns from the Dash effect will be resolved to simple (on-off) dashes in the output tiles.

  • If the resulting tile package is less than 500 GB, you can upload it directly in a browser to ArcGIS Online or ArcGIS Enterprise or use the Share Package tool to upload it to ArcGIS Online or ArcGIS Enterprise. See Publish a vector tile layer from a cache dataset for more information.

  • To learn more about creating and symbolizing vector tiles, see Author a map for vector tile creation and Symbology in vector tiles.

Parameters

LabelExplanationData Type
Input Map

The map from which tiles will be generated and packaged. The input map must have metadata description and tags.

Map
Output File

The output vector tile package. The file extension of the package is .vtpk.

File
Package for ArcGIS Online | Bing Maps | Google Maps

Specifies 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.

  • Checked—The ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. This tiling scheme allows you to overlay cache tiles with tiles from these online mapping services. ArcGIS Pro includes this tiling scheme as a built-in option when loading a tiling scheme. When you check this parameter, the data frame of the source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.
  • Unchecked—A tiling scheme from an existing vector tile service will be used. Only tiling schemes with scales that double in progression through levels and have 512-by-512 tile size are supported. You must specify a vector tile service or tiling scheme file for the Tiling scheme parameter.

  • OnlineThe ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. This tiling scheme allows you to overlay cache tiles with tiles from these online mapping services. ArcGIS Pro includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this option, the data frame of the source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.
  • ExistingA tiling scheme from an existing vector tile service will be used. Only tiling schemes with scales that double in progression through levels and have 512-by-512 tile size are supported. You must specify a vector tile service or tiling scheme file in the tiling_scheme parameter.
Boolean
Tiling scheme
(Optional)

A vector tile service or tiling scheme file that will be used if the Package for ArcGIS Online | Bing Maps | Google Maps parameter is unchecked. The tiling scheme tile size must be 512 by 512 and must have consecutive scales in a ratio of two.

Map Server; File
Tiling Format
(Optional)

Specifies whether the tile generation structure will be optimized with an indexed structure or as a flat array of all tiles at all levels of detail. The optimized indexed structure is the default and results in a smaller cache.

  • IndexedTiles that are based on an index of feature density that optimizes the tile generation and file sizes will be produced. This is the default.
  • FlatRegular tiles for each level of detail will be produced without regard to feature density. This cache is larger than that produced with an indexed structure.
String
Minimum Cached Scale
(Optional)

The minimum (smallest) scale at which tiles will be generated. This does not need to be the smallest scale in the tiling scheme. The minimum cached scale determines which scales will be used to generate cache.

Double
Maximum Cached Scale
(Optional)

The maximum (largest) scale at which tiles will be generated. This does not need to be the largest scale in the tiling scheme. The maximum cached scale determines which scales will be used to generate cache.

Double
Index Polygons
(Optional)

A pregenerated index of tiles based on feature density, applicable only when the Tiling Format parameter is set to Indexed. Use the Create Vector Tile Index tool to create index polygons. If no index polygons are specified for this parameter, optimized index polygons will be generated during processing to aid in tile creation, but they will not be saved or output. The index polygons must use the same coordinate system as the Tiling Scheme parameter value.

Feature Layer
Summary
(Optional)

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

String
Tags
(Optional)

The tag information that will be added to the properties of the output vector tile package. Separate multiple tags with commas or semicolons.

String

arcpy.management.CreateVectorTilePackage(in_map, output_file, service_type, {tiling_scheme}, {tile_structure}, {min_cached_scale}, {max_cached_scale}, {index_polygons}, {summary}, {tags})
NameExplanationData Type
in_map

The map from which tiles will be generated and packaged. The input map must have metadata description and tags.

Map
output_file

The output vector tile package. The file extension of the package is .vtpk.

File
service_type

Specifies 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.

  • ONLINEThe ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. This tiling scheme allows you to overlay cache tiles with tiles from these online mapping services. ArcGIS Pro includes this tiling scheme as a built-in option when loading a tiling scheme. When you choose this option, the data frame of the source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.
  • EXISTINGA tiling scheme from an existing vector tile service will be used. Only tiling schemes with scales that double in progression through levels and have 512-by-512 tile size are supported. You must specify a vector tile service or tiling scheme file in the tiling_scheme parameter.
Boolean
tiling_scheme
(Optional)

A vector tile service or tiling scheme file that will be used if the service_type parameter is set to EXISTING. The tiling scheme tile size must be 512 by 512 and must have consecutive scales in a ratio of two.

Map Server; File
tile_structure
(Optional)

Specifies whether the tile generation structure will be optimized with an indexed structure or as a flat array of all tiles at all levels of detail. The optimized indexed structure is the default and results in a smaller cache.

  • INDEXEDTiles that are based on an index of feature density that optimizes the tile generation and file sizes will be produced. This is the default.
  • FLATRegular tiles for each level of detail will be produced without regard to feature density. This cache is larger than that produced with an indexed structure.
String
min_cached_scale
(Optional)

The minimum (smallest) scale at which tiles will be generated. This does not need to be the smallest scale in the tiling scheme. The minimum cached scale determines which scales will be used to generate cache.

Double
max_cached_scale
(Optional)

The maximum (largest) scale at which tiles will be generated. This does not need to be the largest scale in the tiling scheme. The maximum cached scale determines which scales will be used to generate cache.

Double
index_polygons
(Optional)

A pregenerated index of tiles based on feature density, applicable only when the tile_structure parameter is set to INDEXED. Use the Create Vector Tile Index tool to create index polygons. If no index polygons are specified for this parameter, optimized index polygons will be generated during processing to aid in tile creation, but they will not be saved or output. The index polygons must use the same coordinate system as the tiling_scheme parameter value.

Feature Layer
summary
(Optional)

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

String
tags
(Optional)

The tag information that will be added to the properties of the output vector tile package. Separate multiple tags with commas or semicolons.

String

Code sample

CreateVectorTilePackage example 1 (Python window)

The following script demonstrates how to use the CreateVectorTilePackage function in the Python window to create vector tile package for the first map in the project.

import arcpy
arcpy.env.workspace = "C:/TilePackageExample"
aprx = arcpy.mp.ArcGISProject("CURRENT")
map = aprx.listMaps()[0]
arcpy.management.CreateVectorTilePackage(map, 'Example.vtpk', "ONLINE", "", "INDEXED", 295828763.795777, 564.248588)
CreateVectorTilePackage example 2 (stand-alone script)

This stand-alone script demonstrates the CreateVectorTilePackage function.

# Name: CreateVectorTilePackage.py
# Description: Find all the maps in the project and
#   create a vector tile package for each map
# import system modules
import os
import arcpy

#set environment settings
arcpy.env.overwriteOutput = True
outputPath = "C://Tilepackages//"

# Loop through the project, find all the maps, and
#   create a vector tile package for each map,
#   using the same name as the map
p = arcpy.mp.ArcGISProject("c:\\temp\\myproject.aprx")
for m in p.listMaps():
    print("Packaging " + m.name)
    arcpy.CreateVectorTilePackage_management(m, outputPath + m.name + '.vtpk', "ONLINE", "", "INDEXED", 295828763.795777, 564.248588)

Licensing information

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

Related topics