Using a map cache |
|
Release 9.3 |
This topic contains three parts. The first section outlines how ArcGIS applications access and use the tiles in a map cache. The second part explains how these applications store the tiles for later use. The final section provides some instructions for overlaying map caches in ArcGIS applications.
When you finish generating a map cache, the map service is automatically restarted and it immediately begins using the cache. Any ArcGIS application that can display a map service uses the cache, although how the tiles are retrieved and used varies between applications.
You add cached map services to your Web Application Developer Framework (ADF) applications the same way that you add any other map service. The Map control understands whether the service is cached and works with the service to get the cache tiles if they are available.
After an initial connection to the GIS server, Web ADF applications retrieve tiles directly from the virtual cache directory. This is the fastest way for the application to get the tiles.
If the virtual cache directory is unavailable, the application may still be able to get the tiles from the cache directory on the file system. See the Map Control discussion in the Developer Help for examples of ways that the application can attempt to retrieve a tile that is not immediately available through the virtual cache directory.
If you are viewing a single cached service in a Web ADF application and you pan to an area where tiles do not exist, the application will not display a dynamic image; you will see nothing. One way to ensure that you see a map when you pan to an uncached area is to enable on-demand caching.
If you are overlaying caches and the application cannot get any tiles for one of the services, it will treat that service as dynamic.
Performance tip: If tiles appear more slowly than expected, verify that they are being retrieved from the virtual cache directory. Right-click the map in a Web browser and view the image's properties.
http://myServer/arcgiscache/myService/Layers/_alllayers/L00/R00001019/C00000c55.png
http://myServer/arcgis/services/myService/MapServer?mapname=Electric%20Solutions&level=14&column=2851&row=6544&format=PNG24&time=1191520207507
Multilayer caches are not recommended for use inside of Web ADF applications and will not provide a performance benefit over using a dynamic service. You may be able to overlay two or more fused caches to achieve the same visual effect as a multilayer cache. To do this, use the following workflow:
The Web ADF only maintains a local cache of tiles while you are panning. As soon as you zoom to a different level, the local cache is cleared.
You add cached map services to ArcMap using the Add Data button the same way you add any other map service. After an initial connection to the GIS server to determine if the service has a cache, ArcMap retrieves tiles from the cache directory on the server's file system. When a request is made for a tile at a scale that exactly matches a scale level in the cache, the map service returns the tile directly.
Most often, requests do not exactly match the scale levels in the cache. In this situation, ArcMap generally requests the tile from the next closest scale level and resamples it to match the requested scale. This resampling is still much quicker than generating a tile dynamically; however, it does result in an image that looks different than the original tile. Map labels that have been cached may be difficult to read at certain scales in ArcMap due to this resampling. For best results, view the map at or near the scales from which the cache was created.
ArcMap is the most practical client for consuming multilayer caches. This is because ArcMap has the ability to blend and label multilayer cache tiles on the client side (unlike Web ADF applications).
Although ArcGlobe and ArcGIS Explorer have the ability to add map services as data and consume map caches, you will achieve better performance in these applications by using ArcGIS Server globe services.
One scenario where you still may want to add a map service to ArcGlobe is when you've created a 2D map cache and you want to create an identical 3D globe cache from the 2D cache. In this scenario, you would only be concerned with generating the cache and would not be navigating the globe.
ArcMap, ArcGIS Explorer, and ArcGlobe all maintain local caches of the tiles you have visited. When you zoom and pan back to these areas, the application uses the local cache and does not have to retrieve the tiles from the server again.
You can choose whether you want to save the local cache on disk for use in future sessions or use the local cache for the current session only.
You can also choose not to cache tiles locally. Although this will cause you to lose the performance benefit of local caching, you can always be sure that you are getting the latest tile from the server.
It's possible that the server administrator has disabled local caching of the layer, which also means that you will always get the most up-to-date tile. If this is the case, the other options for saving the cache locally will be unavailable.
If the server administrator updates an area of the server cache that you have already viewed, you must clear your local cache to see the changes. ArcMap, ArcGIS Explorer, and ArcGlobe cannot detect if a cache has been updated. If you are a server administrator, you need to alert your users when updated data is available so that they know to clear their cache.
When designing map caches that will be overlaid with other map caches, there are some important cache design factors to consider depending on which application will be used to view the caches.
When designing map caches that will overlay other map caches in a Web ADF application, there are certain rules you need to follow to ensure the caches overlay successfully. These rules differ depending on whether you are using ArcGIS Server for the Microsoft .NET Framework or ArcGIS Server for the Java Platform. You can find specific guidelines at the following links:
You can overlay any number of map caches in ArcMap. The caches do not have to have the same tiling schemes or projections; however, because of the resampling and reprojecting that ArcMap performs, using equivalent tiling schemes and projections may improve the performance and aesthetic quality of your map.