Before you build a map cache, it's important to think about the tiling scheme you'll use and the resources that will be needed to build the cache. You may also need to do extra design work on your map document to make sure it's usable at each scale level in your tiling scheme.
Creating a large cache can take significant time and resources, so you want to make sure you'll be getting what you expect before you start the cache generation. If possible, run a test build of the cache on a smaller map area, or create just the first few levels of the cache to make sure your images appear as you expect.
Caches can be stored on any machine in your GIS or web server tier, on a separate storage area network (SAN), or on network-attached storage (NAS) devices. If resources are available, you can dedicate one or more machines in your deployment solely for building and storing caches.
By default, the minimum space in which Windows can store a file (cluster size) is 4 kilobytes. If you're creating an exploded cache containing many tiles less than 4 KB in size, you'll notice that the size the cache takes up on disk is much larger than the actual size of the files. To minimize this wasted space, you can use the compact cache storage format, or store your tiles on a disk or partition that has been formatted with a smaller cluster size, such as 1 KB or 512 bytes.
The best way to know whether many of your tiles will be smaller than the cluster size is to create a test cache of a representative area in your map and examine the resulting tile sizes. Types of caches that tend to have small file sizes and thereby may be best to store with smaller cluster sizes include the following:
- PNG 8 caches
- Caches with scattered features designed to overlay a basemap
- Caches with relatively small tile dimensions (256 by 256 or smaller); includes caches designed to overlay Google Maps or Bing Maps
- Caches with many empty tiles due to large scales, barren areas, or lack of data
The above points about small file sizes only apply to the exploded storage format. In contrast, the compact storage format is designed to save wasted space by storing the tiles in a continuous indexed stream of data. For more information, see Available map cache properties.
Design maps that will be cached
When you create a paper map, it's visible at one scale only. Insets that show detailed areas of the map may use one or two additional scales. Fine-tuning your map for accurate generalization, symbology, and labeling can be a challenge even with this small number of scales. When you create a map that will be cached and viewed on a computer screen, you have the added responsibility of making sure the map is readable and useful at all cached scales.
Start with a template
You can download examples of multiscale maps. These map templates include a sample map document, which you can modify to fit your own data and design needs. Even if you don't plan to use the templates, just downloading a few and examining the organization of the map table of contents and datasets can help you learn how to build a successful multiscale map.
The remainder of this help topic delves into the design principles for cached maps, which you can see applied in the templates. If you're designing a map that will overlay ArcGIS Online, Bing Maps, or Google Maps services in a web app, you should also read Designing a map to overlay ArcGIS Online, Google Maps, or Bing Maps.
Choose scales and setting scale dependencies
You can ensure that your map is well designed by applying scale dependencies to labels and features. Examine the example cached images below. As you zoom in on the map, notice how the words and symbols change to convey more information. Road lines become thicker, and cities are represented by polygons instead of points. Similarly, the map switches to more detailed datasets, as the datasets used when zoomed out are too coarse to be useful at closer zoom levels. Streets and their labels only appear at the closest scales, since they would otherwise clutter the map. These scale-dependent changes help the map convey more information in an organized manner.
You can configure any features or labels on your map to only be visible at certain scales or to draw in different ways depending on the scale. The scale dependencies you set for your map layers and the scale levels you choose for your tiling scheme should be carefully coordinated. Any features to which you apply a scale dependency are useless unless your tiling scheme includes a scale level at which they are visible.
For example, if you've used scale ranges to reveal certain features when the user zooms in beyond 1:2,000, you do not want your cache's closest scale to be 1:2,500, or the user will never see the features. Adding a 1:1,250 scale to the tiling scheme would ensure that users could see the features. If you didn't want to add the extra scale, you could change the scale range so the features appeared when zoomed in beyond 1:3,000.
If you are responsible for caching a map that you cannot change, you can still design the tiling scheme to take advantage of the map's characteristics. If possible, open the map in ArcMap and examine the layer properties to determine whether there are any scale-dependent layers and at which scales they turn on and off. If a layer does have a scale dependency, consider including a scale level in your tiling scheme at which the layer is visible. For example, if a layer is set to be visible between the scales 1:150,000 and 1:250,000, you can include 1:200,000 as a scale in your tiling scheme to ensure the layer appears in your cache.
Choose a coordinate system
The data frame that you cache can use any coordinate system. However, if you'll be overlaying your cache with another cache, you should use the same coordinate system for both. This also applies if you're overlaying your cache with tiles from an online mapping service. ArcGIS Online services, Google Maps, and Microsoft Bing Maps all use the WGS 1984 Web Mercator (Auxiliary Sphere) projected coordinate system.
Plan layer visibility
The caching tools combine all the layers in your map service into one image. Consequently, you can't turn layers on and off. This behavior makes your cache fast. It's quicker for the server to get one image than to get many images.
So how do you keep the ability to turn layers on and off? One solution is to group related sets of layers in your map, then put each group in its own map document. Publish a map service, and create a cache from each map document.
For example, suppose you have a map document with these layers: Banks, Restaurants, Museums, Libraries, Shopping centers, Parcels, Roads, Rivers, County boundaries, Lakes, Parks, and Elevation.
If you're just using ArcMap to view the document, you can turn these layers on and off at will. However, if you're going to publish this map on the web using map caches, you'll want to combine some of the layers. Examining the layer list, you might come up with these three logical groupings from which you could make separate map documents:
Map document 1 (Points of interest)
- Shopping centers
Map document 2 (Cultural landscape)
- County boundaries
Map document 3 (Physical features)
For each map document, you can create a map service with a cache. Be sure to use the same tiling scheme for each cache. Then you can overlay the three map services.
If you feel that there may be no need to view physical features separate from the cultural landscape, you could safely combine map documents 2 and 3 into one map document, thereby improving performance even more.
Cache creation time
When you create a cache for a map service, the server must draw map images that cover the full extent of the area you designated for the cache at each scale level you indicated. Additionally, it must create the files and folder structure necessary to contain the cache.
The time needed to create the cache also depends on the scale levels you've chosen, the amount of server resources you've dedicated to building the cache, and the density of information in the map. Even using a powerful server, a large cache can sometimes take days to generate. In many cases, the performance benefit gained from using the cache still outweighs the long time necessary to create the cache.
When choosing the scale levels for your cache, remember that the closer you zoom in on the map, the more tiles are required to cover the map extent and the longer it will take your cache to generate. Every time you halve the scale's denominator, it takes four times as many tiles to cover a square area of the map. For example, a square map at 1:500 scale contains four times more tiles than a map at 1:1,000 scale, and a square map at 1:250 contains 16 times more tiles than a map at 1:1,000 scale.
To get an idea of how quickly the number of tiles in a cache can increase, open your map in ArcMap. Zoom out so that you can see an area of the map in a space about 256 pixels wide by 256 pixels high. (This area will vary depending on your display settings. Chances are it's 2.5–3.25 inches [6.35–8.26 centimeters] on a side.) At this scale, it would take one cache tile at default settings to cover the area. Now halve the denominator of the current scale. (For example, if you were originally viewing the map at 1:40,000 scale, zoom in to 1:20,000.) At this scale, it would take four tiles to cover the same area. Halve the denominator again, and it would take 16 tiles to cover the area. This table shows how the number of tiles needed to cover the original square area would increase with each halving of the denominator. The first scale of 1:32,000,000 can cover an area approximately the size of the western United States in one 256 x 256 pixel tile.
|Level||Scale||Number of tiles|
The more instances of the CachingTools geoprocessing service that you have dedicated to working on the cache, the faster it will generate. See Allocation of server resources to creating a map cache for guidelines on how many instances to devote to caching.
Density of information in the map
The cache size and time needed to create the cache are both affected by the density of information within the map. Areas of the map with many changing colors and patterns will yield larger-sized cache tiles than more homogeneous areas. For example, maps with high-resolution raster images will probably cause large tile sizes, not because of the original image size on disk, but because of the variation in color and pattern between the image pixels.
Similarly, maps that contain many layers and take relatively long amounts of time to be drawn in ArcMap will typically require more time for creating a cache. This is because the server must repeatedly draw the appropriate layers of the map as it creates the tiles for each scale level.