Label | Explanation | Data Type |
Input Map
| The input map with the feature distribution and vertex density that determine the size and arrangement of output polygons. The input map is typically one that you will subsequently use to create vector tiles using the Create Vector Tile Package tool. | Map |
Output Tile Feature Class
| The output polygon feature class of indexed tiles at each level of detail. Each tile encloses a manageable number of input vertices not exceeding the number specified by the Maximum Vertex Count parameter. | Feature Class |
Package for ArcGIS Online | Bing Maps | Google Maps
| Specifies whether the tiling scheme will be generated from an existing map service or for ArcGIS Online, Bing Maps, and Google Maps.
| Boolean |
Tiling scheme
(Optional) |
The vector tile service or tiling scheme file that will be used if the Package for ArcGIS Online | Bing Maps | Google Maps parameter is not checked. The tiling scheme tile size must be 512 by 512 and must have consecutive scales in a ratio of two. | Map Server; File |
Maximum Vertex Count
(Optional) | The ideal number of vertices from all visible layers to be enclosed by each polygon in the output feature class. The default value is the recommended count of 10,000 vertices. | Long |
Summary
Creates a multiscale mesh of polygons that can be used as index polygons when creating vector tile packages.
Illustration
Usage
The resulting mesh of polygons is multiscale, representing different levels of detail as defined in the input map. The highest level of detail polygons are sized to enclose no more than the specified vertex count from features from the input map as determined by their density, distribution, and the inherent generalization that occurs when creating vector tiles. The maximum level of detail of the resulting polygons will not exceed 16.
The PTS field value in each polygon indicates the number of vertices each polygon contains from the source data. Examine high values in this field across the index polygons to find areas that are high in vertex count and may result in poor performing vector tiles.
The LOD field value in each polygon indicates the level of detail (LOD). Sort the field values to find the maximum LOD for the map. The maximum LOD represented by the index polygons may not match the maximum LOD specified in the tiling scheme. Since vector tile layers support a lightweight and efficient tile solution, the maximum LOD should be sufficient. Vector tile layers use oversampling for viewing detail beyond the maximum LOD.
The LEAF field value in each polygon indicates whether the tile will overzoom as you render the vector tile layer. The LEAF field values are as follows:
- LEAF = 0 indicates that the tile will not overzoom.
- LEAF = 1 indicates that the tile will overzoom when zooming beyond its LOD value.
The output feature class is suited for use with the Create Vector Tile Package tool as the input index polygons. The Create Vector Tile Package tool will use these polygons to create tiles that are optimized for feature density across the multiple levels of detail being created. The smallest and largest LOD values will be stored as minLOD and maxLOD values for the vector tiles.
This tool will use the index polygons as follows:
- When using an indexed tile structure—The tool will use the output polygons to create tiles that are optimized for feature density across the multiple levels of detail being created. The smallest and largest LOD values will be stored as minLOD and maxLOD values for the vector tiles.
- When using a flat tile structure—The tool will use the output polygons to generate an intermediate indexed cache from which the flat cache will be generated, speeding up the process of generating vector tiles for the map or basemap.
To learn more about creating vector tiles, see Author a map for vector tile creation.
Parameters
arcpy.management.CreateVectorTileIndex(in_map, out_featureclass, service_type, {tiling_scheme}, {vertex_count})
Name | Explanation | Data Type |
in_map | The input map with the feature distribution and vertex density that determine the size and arrangement of output polygons. The input map is typically one that you will subsequently use to create vector tiles using the Create Vector Tile Package tool. | Map |
out_featureclass | The output polygon feature class of indexed tiles at each level of detail. Each tile encloses a manageable number of input vertices not exceeding the number specified by the vertex_count parameter. | Feature Class |
service_type | Specifies whether the tiling scheme will be generated from an existing map service or for ArcGIS Online, Bing Maps, and Google Maps.
| Boolean |
tiling_scheme (Optional) |
The 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 |
vertex_count (Optional) | The ideal number of vertices from all visible layers to be enclosed by each polygon in the output feature class. The default value is the recommended count of 10,000 vertices. | Long |
Code sample
The following Python window script demonstrates how to use the CreateVectorTileIndex function in immediate mode.
import arcpy
arcpy.env.workspace = "C:/data/cartography.gdb/transportation"
arcpy.CreateVectorTileIndex_management("CURRENT", "tiles", "ONLINE", "", 10000)
This stand-alone script shows an example of using the CreateVectorTileIndex function.
# Name: CreateVectorTileIndex.py
# Description: Find all the maps in the project and
# create vector tile index polygon feature class 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
# creates vector tile index polygon for each map,
# using the same name as the map
p = arcpy.mp.ArcGISProject("c:\\temp\\myproject.aprx")for m in p.listMaps():
print("Creating Vector Tile Index for: " + m.name)
arcpy.CreateVectorTileIndex_management(m, outputPath + m.name + '.shp', "ONLINE", "", 10000)