Map Server Cache Tiling Scheme To Polygons (Cartography)
Summary
Creates a new polygon feature class from an existing tiling scheme.
This tool subdivides a data frame 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 in the installation directory of ArcGIS for Desktop (example: C:\Program Files\ArcGIS\Desktop10.1\TilingSchemes).
- 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 (example: C:\arcgisserver\arcgiscache\MyService\MyDataFrame\conf.xml).
- Create your own tiling scheme file. For more information see Available map cache properties in the ArcGIS for Server Help.
-
The output feature class from this tool may be used as input into 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.
Syntax
Parameter | Explanation | Data Type |
map_document |
The source map document. | ArcMap Document |
data_frame |
The data frame from the source map document. | String |
tiling_scheme |
Path to a predefined tiling scheme .xml file. | File |
output_feature_class |
The output polygon feature class. | Feature Class |
use_map_extent |
Choose whether to produce tiles for the entire extent of the tiling scheme or only tiles that intersect the full extent of the data frame.
| Boolean |
clip_to_horizon |
Choose whether to constrain the polygons to the valid area of use for the geographic or projected coordinate system of the data frame.
| Boolean |
antialiasing (Optional) | Choose whether to generate polygons that match map service caches with anti-aliasing enabled. 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 check to see if the <Antialiasing> tag is set to true.
| Boolean |
levels [level,...] (Optional) | The scale levels at which you will create polygons. To create polygons for all scale levels included in a tiling scheme, leave this parameter blank. You may choose to create polygons for all or only some of the scale levels that are included in your tiling scheme. To add additional scale levels, however, you will need to modify your tiling scheme file or create a new one. | Double |
Code Sample
The following stand-alone script demonstrates how to use the MapServerCacheTilingSchemeToPolygons function.
import arcpy
from arcpy import env
env.workspace = "C:/data/data.gdb"
arcpy.MapServerCacheTilingSchemeToPolygons_cartography("C:/data/Annotation.mxd",
"Layers",
"C:/Program Files/ArcGIS/Desktop10.1/TilingSchemes/ArcGIS_Online_Bing_Maps_Google_Maps.xml",
"Tiles","USE_MAP_EXTENT","CLIP_TO_HORIZON", "NONE", "")
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 for Desktop Advanced license
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data/data.gdb"
# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
inDataFrame = "Layers"
inTilingScheme = "C:/Program Files/ArcGIS/Desktop10.1/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, inDataFrame, inTilingScheme, outFeatureClass,
inTileExtent, inClipping, inAntialiasing, inScales)
# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
inDataFrame = "Layers"
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, inDataFrame, inPolygonIndexLayer, inOutGeodatabase,
outOutLayer, inAnnoSuffix, inRefScaleValue, inRefScaleField,
inTileIDField, inCoordSysField, inMapRotationField,inFeatureLinked,
inGenerateUnplaced)