Skip To Content

Create Vector Tile Index

Summary

Creates a multiscale mesh of polygons that can be used as index polygons when creating vector tile packages.

Illustration

Multiscale mesh of vector tile index polygons covering Australia and New Zealand
Multiscale mesh of vector tile index polygons covering Australia and New Zealand

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 PTS field in each polygon indicates the number of vertices each polygon contains from the source data. Examine high values in this field across your index polygons to find areas that are high in vertex count and could result in poor performing vector tiles.

  • The output feature class is ideally suited for use with the Create Vector Tile Package tool as the input index polygons when using an indexed tile structure. The Create Vector Tile Package tool uses these polygons to create tiles optimized for feature density across the multiple levels of detail being created.

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

Syntax

CreateVectorTileIndex_management (in_map, out_featureclass, service_type, {tiling_scheme}, {vertex_count})
ParameterExplanationData Type
in_map

The input map whose feature distribution and vertex density dictate 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

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.

  • ONLINEThe ArcGIS Online/Bing Maps/Google Maps tiling scheme will be used. The ArcGIS Online/Bing Maps/Google Maps tiling scheme allows you to overlay your 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 tiling scheme, the data frame of your source map must use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system. This is the default.
  • EXISTINGThe 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 to 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.

MapServer; 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

CreateVectorTileIndex example (Python window)

The following Python window script demonstrates how to use the CreateVectorTileIndex tool in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data/cartography.gdb/transportation"
arcpy.CreateVectorTileIndex_management("CURRENT", "tiles", "ONLINE", "", 10000)
CreateVectorTileIndex tool example 2 (stand-alone script)

This stand-alone script shows an example of using the CreateVectorTileIndex tool.

# 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)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics