Scheduling and Pre-caching Tiles for Base Layers

Infrastructure Studio pre-generates and caches base layers to save time later, when you publish your map. This pre-caching operation can take a long time. If you have collected your base layers in a base layer group, you can generate the pre-cached layers on demand, or you can create a script and schedule them to generate at a specific time--for example, during the evening when processing resources are more readily available.

To use this feature, you must have a map definition that includes one or more base layer groups. You indicate how many zoom levels you want for each layer group when you define the groups. The more zoom levels you create, the smoother the zooming process will be when users view the map. However, more zoom levels take longer to pre-cache. For information on creating base layer groups and setting their zoom levels, see Setting Up Base Layer Groups.

When you pre-cache base layers, you create tiles that represent the base layer groups at their defined zoom levels. You can pre-cache the entire map, or just specific areas. You might want to pre-cache tiles only for areas whose data has changed recently. For example, you might want to pre-cache the downtown area of a city, which might change more frequently than the surrounding countryside.

Using Scripts

You can save the pre-caching parameters as a script, which is stored as a DOS .bat file. You can then use the Windows Scheduler (or another scheduling application) to run the script at a particular time.

This example shows a tile script:

@echo off
pushd "C:\Program Files\Autodesk\InfrastructureStudio2012"
Autodesk.Infrastructure.Studio.PreCacheTilesCommandLine.exe --siteurl="http://localhost:8088/mapserver2012" --username="Administrator" --password="DaozQFNP8HA=" --mapdefinitions="Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition" --basegroups="Base Layer Group"$scaleindex=0,1,2,3,4,5,6,7,8,9 --threadcount="1" 
popd

To schedule and pre-cache base layer groups

  1. Right-click a map definition that includes base layer groups and click Pre-cache Tiles.
  2. Select the base layer groups and scale ranges to pre-cache.

    The entries in this area (the base layers and their scale ranges) are determined by how you defined the base layer groups. For information on creating base layer groups and setting their scale ranges, see Setting Up Base Layer Groups.

  3. If you do not want to include the entire map, specify the bounds of the area to preprocess.
    • Click Define Bounding Area.
    • Draw a rectangle in the preview area to represent the tiles to pre-cache.

      By default, the bounding text area displays the coordinates for the entire map, but these are replaced by the coordinates for the area you define. You can manually edit the coordinates in the bounding text area. To specify different bounds, click Clear Bounds and then define a new set of bounds.

  4. Indicate whether to process multiple layers at a time.

    The number of requests that can be processed at a time depends on the memory and processing power of your computer.

  5. Do one of the following:
    • To generate the pre-cached tiles, click Generate.

      A progress indicator tells you how many tiles have been generated and allows you to cancel the operation. If errors occur (for example, if the bounding coordinates are invalid), you will see an error message. At the end of the process, the message will indicate whether there were any tiles that could not be generated.

    • To save the parameters for this map definition as a script, click Save Script.

      Specify a name and location for the script and click Save. You can use a scheduling application to run the script later, or on a regular basis.