Map Server Cache Tiling Scheme To Polygons (Cartography)

Summary

Creates a new polygon feature class from an existing tiling scheme.

This tool subdivides a map extent using the same scales as an existing map service cache tiling scheme and creates tiles over a large area, or supertile. Since the supertile extent is larger than the actual tiles defined in the scheme, tiles used as input into the Tiled Labels To Annotation tool can convert labels to annotation over a larger area at a time. This process minimizes annotation duplication across tiles.

Usage

  • There are several options for loading an existing tiling scheme:

    • Load a tiling scheme from an online mapping service such as ArcGIS Online, Google Maps, Bing Maps, or Yahoo. These tiling schemes are located under the installation directory of ArcGIS Pro in the Resources\TilingSchemes folder.
    • Load a tiling scheme file from an existing map service cache. All map caches have a tiling scheme file, conf.xml, in the cache directory (for example, C:\arcgisserver\arcgiscache\MyService\MyDataFrame\conf.xml).
    • Create your own tiling scheme file using the Generate Map Server Cache Tiling Scheme tool.

  • The output feature class from this tool can be used as input to the Tiled Labels To Annotation tool.

  • For the Clip tiles at the coordinate system horizon parameter, the coordinate system horizon is the valid area of use for a particular geographic or projected coordinate system.

Parameters

LabelExplanationData Type
Input Map

The current map to be used.

Map
Tiling Scheme

A predefined tiling scheme .xml file.

File
Output Feature Class

The output polygon feature class.

Feature Class
Generate polygons that intersect the map extent

Specifies whether polygon features will be created for the entire extent of the tiling scheme or only those tiles that intersect the full extent of the map.

  • Checked—Polygon features will be created for the full extent of the map. This is the default.
  • Unchecked—Polygon features will be created for the full extent of the tiling scheme.
Boolean
Clip tiles at the coordinate system horizon

Specifies whether polygons will be constrained to the valid area of use for the geographic or projected coordinate system of the map.

  • Checked—Polygon features will only be created within the valid area of use for the geographic or projected coordinate system of the map. Tiles that are within the extent of the tiling scheme but outside the extent of the coordinate system horizon will be clipped. This is the default.
  • Unchecked—Polygon features will be created for the full extent of the tiling scheme. Within each scale level, polygons will be of a uniform size and will not be clipped at the coordinate system horizon. This may create data that is outside the valid area of use for the geographic or projected coordinate system. If a scale within the tiling scheme would generate a tile that is larger than the spatial domain of the feature class, null geometry will be created for that feature.
Boolean
Generate polygons that match map service caches with anti-aliasing enabled
(Optional)

Specifies whether polygons that match map service caches with antialiasing enabled will be generated. A map service cache supertile is 2048 x 2048 pixels with antialiasing or 4096 x 4096 pixels without. To see if antialiasing was used in an existing cache, open the tiling scheme file, conf.xml, and see if the <Antialiasing> tag is set to true.

  • Checked—Polygon tiles will be generated to match the supertile extent of a map service cache with antialiasing enabled.
  • Unchecked—Polygon tiles will be generated to match the supertile extent of a map service cache without antialiasing enabled. This is the default.
Boolean
Scales
(Optional)

The scale levels at which polygons will be created. These scale levels automatically populate based on the scale levels in the input tiling scheme. You can create polygons for all or only some of the scale levels that are included in your tiling scheme. To add more scale levels, however, you must modify your tiling scheme file or create a new one, as the Add Value button is not available for this tool.

Double

arcpy.cartography.MapServerCacheTilingSchemeToPolygons(input_map, tiling_scheme, output_feature_class, use_map_extent, clip_to_horizon, {antialiasing}, {levels})
NameExplanationData Type
input_map

The current map to be used.

Map
tiling_scheme

A predefined tiling scheme .xml file.

File
output_feature_class

The output polygon feature class.

Feature Class
use_map_extent

Specifies whether polygon features will be created for the entire extent of the tiling scheme or only those tiles that intersect the full extent of the map.

  • USE_MAP_EXTENTPolygon features will be created for the full extent of the map. This is the default.
  • FULL_TILING_SCHEMEPolygon features will be created for the full extent of the tiling scheme.
Boolean
clip_to_horizon

Specifies whether polygons will be constrained to the valid area of use for the geographic or projected coordinate system of the map.

  • CLIP_TO_HORIZONPolygon features will only be created within the valid area of use for the geographic or projected coordinate system of the map. Tiles that are within the extent of the tiling scheme but outside the extent of the coordinate system horizon will be clipped. This is the default.
  • UNIFORM_TILE_SIZEPolygon features will be created for the full extent of the tiling scheme. Within each scale level, polygons will be of a uniform size and will not be clipped at the coordinate system horizon. This may create data that is outside the valid area of use for the geographic or projected coordinate system. If a scale within the tiling scheme would generate a tile that is larger than the spatial domain of the feature class, null geometry will be created for that feature.
Boolean
antialiasing
(Optional)

Specifies whether polygons that match map service caches with antialiasing enabled will be generated. A map service cache supertile is 2048 x 2048 pixels with antialiasing or 4096 x 4096 pixels without. To see if antialiasing was used in an existing cache, open the tiling scheme file, conf.xml, and see if the <Antialiasing> tag is set to true.

  • ANTIALIASINGPolygon tiles will be generated to match the supertile extent of a map service cache with antialiasing enabled.
  • NONEPolygon tiles will be generated to match the supertile extent of a map service cache without antialiasing enabled. This is the default.
Boolean
levels
[level,...]
(Optional)

The scale levels at which polygons will be created. To create polygons for all scale levels included in a tiling scheme, leave this parameter blank. You can create polygons for all or only some of the scale levels that are included in your tiling scheme. To add more scale levels, however, you must modify your tiling scheme file or create a new one.

Double

Code sample

MapServerCacheTilingSchemeToPolygons example 1 (Python window)

The following stand-alone script demonstrates how to use the MapServerCacheTilingSchemeToPolygons function.


import arcpy
import os

arcpy.env.workspace = "C:/data/data.gdb"
arcpy.MapServerCacheTilingSchemeToPolygons_cartography(
      "C:/data/Annotation.mxd", os.path.join(arcpy.GetInstallInfo()['InstallDir'], 
                                             'Resources\\TilingSchemes\\WGS84_Geographic_Coordinate_System_V2.xml'), 
      "Tiles", "USE_MAP_EXTENT", "CLIP_TO_HORIZON", "NONE")
MapServerCacheTilingSchemeToPolygons example 2 (workflow script)

The following script demonstrates a workflow using the MapServerCacheTilingSchemeToPolygons and the TiledLabelsToAnnotation functions.

# Name: MapServerCacheTilingSchemeToPolygons_Example2.py
# Description: Create a tile feature class and use those tiles to create annotation.
# Requirements: ArcGIS Desktop Advanced license

# Import system modules
import arcpy
import os

# Set environment settings
arcpy.env.workspace = "C:/data/data.gdb"

# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
# Change path below to match your system
inTilingScheme = os.path.join(arcpy.GetInstallInfo()['InstallDir'], 
                              'Resources\\TilingSchemes\\ArcGIS_Online_Bing_Maps_Google_Maps.xml'),
outFeatureClass = "C:/data/data.gdb/Tiles"
inTileExtent = "USE_MAP_EXTENT"
inClipping = "CLIP_TO_HORIZON"
inAntialiasing = "NONE"
inScales = ""

# Execute MapServerCacheTilingSchemeToPolygons
arcpy.MapServerCacheTilingSchemeToPolygons_cartography(
    inMapDocument, inTilingScheme, outFeatureClass, 
    inTileExtent, inClipping, inAntialiasing, inScales)

# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
inPolygonIndexLayer = "Tiles"
inOutGeodatabase = "C:/data/data.gdb"
outOutLayer = "GroupAnno"
inAnnoSuffix = "Anno"
inRefScaleValue = ""
inRefScaleField = "Tile_Scale"
inTileIDField = "OID"
inCoordSysField = ""
inMapRotationField = ""
inFeatureLinked = "STANDARD"
inGenerateUnplaced = "GENERATE_UNPLACED_ANNOTATION"

# Execute TiledLabelsToAnnotation
arcpy.TiledLabelsToAnnotation_cartography(
    inMapDocument, inPolygonIndexLayer, inOutGeodatabase, 
    outOutLayer, inAnnoSuffix, inRefScaleValue, inRefScaleField, 
    inTileIDField, inCoordSysField, inMapRotationField,inFeatureLinked, 
    inGenerateUnplaced)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics