Label | Explanation | Data 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.
| 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.
| 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 |
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
arcpy.management.CreateVectorTilePackage(in_map, output_file, service_type, {tiling_scheme}, {tile_structure}, {min_cached_scale}, {max_cached_scale}, {index_polygons}, {summary}, {tags})
Name | Explanation | Data 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.
| 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.
| 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
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)
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)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes