Welcome to ESRI Blogs

Tips for choosing a cache image format

We often receive questions about which image format is most appropriate for ArcGIS Server map caches. In response we recently added the following information to the topic Choosing Cache Properties in the ArcGIS Server 9.3 Web Help.

Your choice of cache image format is important because it determines the size on disk of the tiles, the image quality, and the ability to make the tile background transparent.

Below is a summary of the available image formats and their appropriate uses.

  • PNG8 - Use this format for overlay services that need to have a transparent background, such as roads and boundaries. PNG 8 creates tiles of very small size on disk with no loss of information. However, you should use a different PNG format if your map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and the antialiasing caching option can easily push your map over 256 colors.
  • PNG24 - You can use this format for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG 8). Do not use PNG 24 if your tiles will be viewed in Internet Explorer version 6 or previous.
  • PNG32 - Use this format for overlay services, such as roads and boundaries, that have more than 256 colors. This format creates larger tiles than PNG 24, but the tiles are fully supported in all browsers.
  • JPEG - Use this format for base map services that have large color variation and do not need to have a transparent background. For example, raster imagery tends to work well with JPEG.

    JPEG is a lossy image format. It attempts to selectively remove data without affecting the appearance of the image. This can cause very small tile sizes on disk, but if your map contains vector linework or labels, it may produce too much "noise" or blurry area around the lines. If this is the case, you can attempt to raise the Compression value from the default of 75. A higher value such as 90 may balance an acceptable quality of linework with the small tile size benefit of the JPEG.

    It's up to you to decide what image quality you consider acceptable. If you are willing to accept a minor amount of noise in the images, you may save large amounts of disk space by choosing JPEG. The smaller tile size also means the browser can download the tiles faster.

Before committing to an image format for a large cache, build a small cache of a representative area of your map and examine the tile quality and performance in a test application. If you'll be working with multiple caches, build a small test cache for each and add them to a test application to make sure they overlay as expected. This will allow you to make adjustments before you create the entire cache.

To make a small test cache you can do any of the following:

  • Set a custom data frame extent to a small area in your source map document and run Manage Map Server Cache Tiles.
  • Run Manage Map Server Cache Tiles and in the tool interface, edit the extent rectangle to be a small area.
  • Use the editing tools in ArcMap to create a new feature class consisting of a small rectangle around the area you want to test. Then select the option at the bottom of the Manage Map Server Cache Tiles tool that allows you to create tiles based on the boundary of a feature class.

Contributed by Sterling Quinn of the ArcGIS Server software development team

Published Friday, October 17, 2008 2:48 PM by sterlingdq
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Tips for choosing a cache image format

Is there any way to tell how many colors your map service has?
Monday, October 20, 2008 7:42 AM by Scott

# re: Tips for choosing a cache image format

We have a 9.2 cached basemap at 1024 x 1024 in PNG24. It looked good and performed OK in 9.2. We do not need to support transparency because it is a basemap. We have a 9.3 test server. I pointed a new duplicated 9.3 map service to the 9.2 cache using a UNC with a shared directory. I was told you could use a 9.2 cache in a 9.3 map service. Originally I had issues because I tried to create the map service on the 9.3 server using a 9.2 desktop ArcCatalog (I still have other 9.2 servers to support). I found that the cfg files are different in 9.3 and 9.2. The REST services and directory did not work. After re-creating the service in 9.3 it looked like everything was OK until someone noticed that the background was transparent. The background is not transparent in the cached PNG images but it is transparent when you preview the map service or the web application. I looked in the cfg and the IsCached tag was set to false. I set it to true and restarted the SOM's service but the background is still transparent. Any ideas what to do other than rebuild the cache fresh in 9.3?
Tuesday, October 21, 2008 4:03 PM by Carol Fackler

# re: Tips for choosing a cache image format

@Carol- A 9.3 map service is designed to be compatible with a cache that was built at 9.2. Not sure what is causing the transparency problem you're seeing- it's probably more about how the 9.3 client is interpreting the image. What client are you using that causes different appearance in 9.2 vs. 9.3?  Can you explain in more detail "the background is not transparent in the cached PNG images but it is transparent when you preview the map service or the web application."?

Sterling

Tuesday, October 21, 2008 4:55 PM by sterlingdq

# re: Tips for choosing a cache image format

Informative post.thanks for sharing

regards

<a href="http://www.sblgis.com/gis-lidar.aspx">Lidar mapping services</a>

Wednesday, November 12, 2008 1:16 AM by SBLGIS38

# re: Tips for choosing a cache image format

Hello, I would like to make a map web site with Cache. I own 4 ArcGIS Servers Licenses I would like to perform the following: As a user asks a map, he gets the tiles from the four Arcgis Servers (Grid working system) so the user gets the map from four servers and not from one. This method better then working with one server. Is there a way to do it?
Thursday, November 13, 2008 9:28 AM by Jeff1910

# re: Tips for choosing a cache image format

@Jeff- When a user connects to a cached service they typically hit the SOC briefly and from then on they get the tiles directly out of the cache directory. In most cases it's sufficient to have one configuration of your service and one cache directory.

A very large deployment (like ArcGIS Online) might have the cache duplicated on several servers, but this is partly to facilitate failover and update workflows. Unless you have thousands of users depending on your cache night and day, it's probably not worth the trouble.

Friday, November 14, 2008 9:58 AM by sterlingdq

Leave a Comment

(required) 
required 
(required)