We’re occasionally asked how to build a partial map cache at large scale levels, while having a full cache at smaller scales. This is useful if you have highly detailed data in certain areas of your map. For example, you might have medium resolution data covering the world and high resolution data covering just your country. How do you get the high resolution data in your cache without having to cache the full extent of the world at large scales?
Every map cache has a tiling scheme that defines the available scale levels. Think of your tiling scheme as an empty container of tiles. You don’t have to completely fill all scale levels in the tiling scheme; you can just partially fill the large scale levels. This post explains how to do that.
How does a tiling scheme get created?
The tiling scheme is represented by a file called conf.xml that is stored in your service’s cache folder in the server cache directory. (For example: c:arcgisserverarcgiscachemyCaliforniaServiceLayersconf.xml).
The way you get a tiling scheme is to run the Generate Map Server Cache tool. This tool creates a tiling scheme file from all the information you provided as tool input, such as the list of scale levels. After creating the tiling scheme, the tool also creates all tiles at all the scales you defined. If your goal is to create a partial cache, you need to stop the tool from creating all the tiles.
How can I create the tiling scheme without creating all the tiles
To get the tiling scheme without getting all the tiles, you can run Generate Map Server Cache and cancel it after about one minute. This won’t erase your tiling scheme; it will just stop the creation of tiles. If you’re nervous about whether one minute is long enough for conf.xml to get created, you can open Windows Explorer and verify that the completed conf.xml is in your cache folder before you cancel the tool.
So if I cancelled Generate Map Server Cache, how do I get tiles into my cache?
Even though you cancelled Generate Map Server Cache, you can still use Update Map Server Cache to add tiles to your cache. This tool isn’t just for updating existing caches; it is also very effective at creating new caches with a fine-grained level of control. You can tell the tool to cache only a subset of scale levels in your tiling scheme over a limited geographic extent.
You’ll need to run Update Map Server Cache several times in order to create your partial cache.
First, run the tool to Recreate All Tiles at small scales only, covering the full extent of the map document. This is the default extent that the tool uses.
The second time that you run the tool you can also choose Recreate All Tiles. But this time, select just the larger scales and give the tool a smaller rectangular extent. If you want to get real specific about which areas are cached at the large scales, you can script Update Map Server Cache to cover a series of rectangular extents. One example of this is Jeremy Bartley’s script that creates tiles based on the extents of features in a feature class.
Here’s a summary of the steps for building a partial cache:
- Run Generate Map Server Cache and cancel it after the tiling scheme file has been created (waiting about one minute should be enough).
- Run Update Map Server Cache on the full extent of your map for the small scales only.
- Run Update Map Server Cache again on a limited extent of your map for the large scales only.
- Optional: Configure your server to return a Data Not Available tile for empty cache areas.
A note about the road ahead…
We’re happy to announce that this workflow has improved in ArcGIS Server 9.3. The Generate Map Server Cache tool will be deprecated in order to separate the workflow of creating the tiling scheme and creating cache tiles. (Your existing scripts will continue to work.) You’ll also be able to create a subset of tiles based on the boundary of a feature class. Finally, you’ll have the option to cache areas on demand as they are visited by users. We plan many blog posts on these topics in the months ahead.