Welcome to ESRI Blogs

Creating a 3D globe cache from a 2D map cache

ArcGIS Online globeOne purpose of this blog is to share some of the things we’ve learned about our software by using it ourselves. The ArcGIS Online project uses the ArcGIS Server map and globe caching technology. In this post, we share a technique we’ve developed to create 3D caches for ArcGIS Online.

For performance and appearance benefits, many of the 3D globe caches on ArcGIS Online were created originally from 2D fused map caches. These 2D caches were overlaid on the globe and cached to make globe tiles. This technique improves the performance of the globe service because it yields only one cached layer. It also improves the appearance of the service because anti-aliasing effects in the 2D cache transfer to the 3D cache. This post lists the steps that you can follow to create a 3D cache from a 2D cache.

The instructions in this post are written for intermediate to advanced ArcGIS Server users. Before attempting this technique, it’s helpful to have some previous experience publishing ArcGIS Server services, creating map caches, and connecting to GIS services in ArcGlobe.

Create the 2D map cache

The first step in this process is to create the 2D cached map service. Start by using ArcMap to create an attractive map document that is designed for display at some pre-determined scale levels. You’ll need to select the scale levels you want cached and then apply the appropriate symbology for each scale level. You can find tips for this process in Planning a map cache.

Below is a list of scale levels used by ArcGIS Online 2D caches. These scale levels translate well to the fixed scale levels used by ArcGIS Explorer and ArcGlobe, and are strongly recommended if you plan on eventually creating a 3D cache from your 2D cache. The high-precision values of the scales prevent tiles from overlapping at the edge of the globe near the International Date Line. If your map does not have worldwide coverage, you do not have to enter all of the decimal places for these numbers, but it’s recommended that you stay close to these numbers for the best visual effects. You do not have to use all of the scales; you can use a sequential subset of them.

Recommended scales for your 2D cache
  • 147748799.285417 (To clarify, this corresponds to approximately 1:147,748,799 scale)
  • 73874399.6427087 (This corresponds to approximately 1:73,874,299)
  • 36937199.8213544 (Etc.)
  • 18468599.9106772
  • 9234299.95533859
  • 4617149.97766929
  • 2308574.98883465
  • 1154287.49441732
  • 577143.747208662
  • 288571.873604331
  • 144285.936802165
  • 72142.9684010827
  • 36071.4842005414
  • 18035.7421002707
  • 9017.87105013534
  • 4508.93552506767

Once you’ve finished designing and creating your map document, you should publish it as an ArcGIS Server map service and create a map cache. If using the above values, you can copy and paste them directly into the Generate Map Server Cache tool. This post does not focus on the details of publishing the 2D service and generating the cache, but ample instructions are available in the ArcGIS Server Help.

Configure a custom error for missing tiles

A previous post on this blog explained how you can configure your web server to return a blank or “No data available” image in areas where a client cannot find a cache tile. This is an important step when you’re generating a 3D cache from a 2D cache because the tile edges may not always line up between the two types of caches. The 3D cache generating process will perform better with a blank or "No data available" tile than it will when no tile is found. Follow the steps at this link to configure your web server to return the blank tile: Configuring your server to display a "Data not available" tile for empty map cache areas.

Create a globe document from the 2D service

Now that you have a 2D map service running, you can add it to an ArcGlobe document. The service will be draped over the globe in 3D. Follow these steps to create and appropriately configure the document:

  1. Start ArcGlobe
    Tip: If you’re using ArcGlobe in a remote desktop session, you may get better performance by resizing the application window to eliminate the globe portion of the display. You don’t need to see the globe during these steps.
  2. Remove the default layers named Continents and World Image.
  3. Click Tools > Options and click the Cache tab.
  4. Set the Cache path to be the same as the server cache directory where you want your globe cache to be created, with "GlobeCache" appended to the end (Example: \\myServer\cache\GlobeCache) This is an application-level property, so you may want to make note of the original cache path and set this value back the next time you use ArcGlobe.
  5. Click OK to dismiss the options dialog, then click the Add Data button.
  6. Add the 2D map service that you created in the previous steps. Be sure to use an Internet connection to ArcGIS Server (not a local connection). ArcGlobe can display the 2D service draped over the globe.
  7. Right-click the map service layer and select Properties.
  8. In the Globe General tab, modify the Layer Name and Description as you like.
  9. Click the Cache tab
  10. If you’re creating a base map layer, such as satellite imagery or a street map, check "Use lossy spatial compression". If you’re creating a transparent reference layer, such as boundaries or a road network, this compression is not necessary.
  11. If you are using the recommended ArcGIS Online scale levels listed above, change the minimum cell size to twice the calculated value. Leaving this unchanged will cause your cache to grow larger than necessary.
  12. Click OK to dismiss the dialog.
  13. Save the globe document and close ArcGlobe.

Create a globe service

Now you need to publish a globe service using the globe document you created in the steps above. You can create the service in ArcCatalog or Manager. Be sure to set the service properties to reference the appropriate cache directory (It’s not necessary to append "GlobeCache" to the name this time.)

The globe service you create should be pooled, with 2 – 4 instances per server object container (SOC) that will be employed in the cache-building process. You may need to adjust this number depending on memory and CPU constraints you observe during the caching process.

Note about number of service instances: The map service that you created earlier only needs to have about ¼ the number of instances that your globe service has at this point. This is because you’ve cached the map service already, so requests for its tiles can be generally satisfied by the virtual cache directory, without making a request to the GIS server. The globe service is going to need a lot of instances while caching. After the cache is generated you can reduce the number of globe service instances.

Generate a globe cache

Once the globe service is started, you can begin generating the cache. You must do this step in ArcCatalog. In the Caching tab of the globe service properties, you’ll find two options for generating the cache. The Generate button creates a cache for the entire globe service, while the Update option only caches an extent that you provide.

As you set the parameters for the caching tools, you’ll need to select the levels of detail that the cache will be created at. Set the From level to "Globe - 1:10000000" even if your service does not have global coverage. This will not generate an unreasonably large cache because tiles that are outside the service extent will just be skipped by the cache generation process.

When selecting the To level of detail, use the table below which associates each ArcGIS Online scale level with the appropriate To level of detail you should use for your globe cache. For example, if your map cache’s closest scale level is 72142.968... choose "City – 1:9765" from the To Level of Detail dropdown in the Generate Globe Server Cache tool. Ignore the scale given in the dropdown (in this example 1:9765).

Scale level Globe cache "To" level of detail
73874399.6427087 Globe
36937199.8213544 Continent
18468599.9106772 Countries
9234299.95533859 Country
4617149.97766929 States
2308574.98883465 State
1154287.49441732 Counties
577143.747208662 County
288571.873604331 Metropolitan Area
144285.936802165 Cities
72142.9684010827 City
36071.4842005414 Town
18035.7421002707 Neighborhood
9017.87105013534 City Blocks
4508.93552506767 City Block

When you’ve set all of the parameters for the caching tools, click OK and let the cache generation process do its work. When it completes, you’ll have a set of globe tiles that look like the tiles in your 2D map cache.

Create a disconnected service (optional)

At this point, you could leave your globe service running and users would see the new cache tiles. However, your map service would always need to be running in order for your globe service to start correctly. To avoid this dependence on the map service, you can do the following to create a disconnected globe service:

  1. Stop the globe service you created previously.
  2. Open ArcGlobe and create a new globe document.
  3. Remove the default layers named Continents and World Image.
  4. Click the Add Data button.
  5. Browse to the folder on disk that contains the globe cache you just created. This involves browsing to your server cache directory, opening the GlobeCache folder, and finding the folder that represents your new globe cache. (Tip: The folder name will probably contain a representation of the URL of your 2D service, for example: ESRI_ServerLyrLocalGlobeCache_http___myserver_arcgis_services_world_mapserver_Layers_world.)
  6. Inside the globe cache’s folder, you’ll see a file named cache.lyr. Add cache.lyr to your map.
  7. Save the globe document and close ArcGlobe.
  8. Use ArcGIS Server to publish the globe document as a globe service. You’ve created a disconnected globe service.

(Note: Creating a 3D cache from a 2D cache using the method described above adds temporary local cache files that can add up to cumbersome sizes during long caching jobs. If this occurs you can use the operating system tools to schedule a task that deletes the local cache periodically, such as every 10 minutes. The local cache is typically stored in C:\Documents and Settings\<SOC account name>\Local Settings\Temp\esrimapcache.)

Do you have a question about this technique or a tip of your own you'd like to share? If so, please leave a comment.

-Sterling Quinn

Published Wednesday, May 30, 2007 3:30 PM by sterlingdq

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: Creating a 3D globe cache from a 2D map cache

Please add the Map Cache tag to this post.
Thursday, May 31, 2007 6:28 AM by Brady

# re: Creating a 3D globe cache from a 2D map cache

Good suggestion. Some of our recent posts were missing tags and I've gone through and added them, including the one you mentioned.

Thursday, May 31, 2007 9:33 AM by sterlingdq

# Viewing cached map services (such as ArcGIS Online) in ArcMap

ArcMap allows you to view cached map services at any scale and projection. When you zoom in to a cached

Monday, July 02, 2007 4:36 PM by ArcGIS Server Development Blog

# Designing a map to overlay ArcGIS Online in a Web application

In November 2006, ESRI announced the public beta release of ArcGIS Online, a set of base map and reference

Tuesday, August 07, 2007 2:42 PM by ArcGIS Server Development Blog

# re: Creating a 3D globe cache from a 2D map cache

In step 4, Set the Cache Path, of "Create a globe document from the 2D service", you do not mention anything about changing the maximum size. 200 MB is not a very large cache size. What exactly does this maximum size refer to and does it need to be changed according to your cache size?
Thursday, March 06, 2008 5:14 PM by Carol Fackler

# re: Creating a 3D globe cache from a 2D map cache

Can you provide some information regarding the correspondence between levels of ArcGlobe disk cache (L09, L10...) and the 'Approximate scale' or 'Far-Near' LOD settings in 'Generate Cache' dialog?
Wednesday, April 02, 2008 8:47 AM by Sergey Naumov

# re: Creating a 3D globe cache from a 2D map cache

ArcGlobe is a paged display application that renders vector, raster and elevation data by tiling it into geographic divisions (faces) and also recursively at varying levels of details (LOD).

(see pages 3-4 of this whitepaper >> http://downloads.esri.com/support/whitepapers/ao_/TipsforDesigningInteractiveArcGlobeDocuments_J9264_.pdf).

The data cache is a persisted representation of this technology that allows organization of visualization pages into a hierarchical file based structure to facilitate paging in and out from disk.

The cache structure is consisted of 6 global faces, of which 4 are equatorial faces, organized in the form of folders named T0, T1, T2 and T3 covering the geographic regions 180°W to 90°W, 90°W to 0°, 0° to 90°E and 90°to 180°E and 45°N to 45°S, and 2 ‘polar’ faces T4 and T5 covering 45°N–90°N and 45°S–90°S, respectively (See graphics on page 2 of the above white paper). Each globe data cache consist of these folders (T0-T5) only if the data set covers/crosses the particular face. Hence a global dataset will have all the faces (T0-T5) where as a data set for southern California, for example, will only consist of T0 folder.

Each of the six major faces is subdivided into multiple tiles at different levels of detail.  Each of this folder/s consist of visualization pages, or tiles, each again organized based on their geographic location (in the form of Rows and columns) and resolution (level of detail).

ArcGlobe supports many data types which could roughly be classified into 3 categories as far as the level of detail classification is concerned; these are Texture data (including feature data represented as rasterized), elevation and Vector (points, lines, 3D objects and billboard annotation).  The level of detail values differ depending on the data type. However, each successive level of detail is derived by recursively dividing the previous level of detail by four.

In Arcglobe data cache structure, the level of detail for all texture data types begin with a L09. This folder corresponds to the lowest level of detail where as L30 correspond to the maximum level possible. Each level correspond roughly to the scales listed below. For raster/image data this levels are primarily driven by the cell size (resolution) of the data.

Elevation data follows similar pattern as imagery, the only exception is elevation data stars from level L08.

Data cache for imagery and elevation data can be generated from the lowest possible LOD value to the maximum supported LOD (based on the cell size). Hence the concept of ‘From’ and ‘To’ LOD values. Also note that when generating data cache you have also the option to generate partial LOD ranges as well.

The level of detail for vector data is solely driven by the ‘scale’ you’d like to visualize it. Note that vector data contains only a single level of detail, hence you’ll only find a single LOD folder for which the feature Level of detail (scale) value was selected for.  For example, if you set the ‘Feature Properties’ value of a vector data to ‘Counties’ (or at a scale of 1: 156543), it will then generate data tiles at level of detail L06  (Vector LOD value in the chart below).

Raster LOD Name Scale 1: Vector Lod Resolution(meters)
9 Globe 10018754.17139462153829420444035, // 0 20000. , // 9
10 Continent 5009377.085697310769147102220175, // 1 10000. , // 10
11 Countries 2504688.5428486553845735511100875, // 2 5000. , // 11
12 Country 1252344.2714243276922867755550438, // 3 2500. , // 12
13 States 626172.13571216384614338777752188, // 4 1250. , // 13
14 State 313086.06785608192307169388876094, // 5 612. , // 14
15 Counties 156543.03392804096153584694438047, // 6 306. , // 15
16 County 78271.516964020480767923472190235, // 7 153. , // 16
17 Metropolitan area 39135.758482010240383961736095118, // 8 80. , // 17
18 Cities 19567.879241005120191980868047559, // 9 40. , // 18
19 City 9783.9396205025600959904340237794, // 10 20. , // 19
20 Town 4891.9698102512800479952170118897, // 11 10. , // 20
21 Neighborhood 2445.9849051256400239976085059448, // 12 5. , // 21
22 City blocks 1222.9924525628200119988042529724, // 13 2.4 , // 22
23 City block 611.49622628141000599940212648621, // 14 1.2 , // 23
24 Buildings 305.74811314070500299970106324311, // 15 0.6 , // 24
25 Building 152.87405657035250149985053162155, // 16 0.3 , // 25
26 Houses 76.437028285176250749925265810776, // 17 0.15 , // 26
27 House Property 38.218514142588125374962632905388, // 18 0.075 , // 27
28 House 19.109257071294062687481316452694, // 19 0.0375 , // 28
29 Rooms 9.5546285356470313437406582263471, // 20 0.0187 , // 29
30 Room 4.7773142678235156718703291131735, // 21 0.0094 , // 30

Hope this information helps.

Tam

Thursday, April 03, 2008 9:34 AM by Tamrat Belayneh

# re: Creating a 3D globe cache from a 2D map cache

The document you reference states, "Full data caching can be accomplished for any layer—exceptions being ArcIMS® and ArcGIS MapServer layers.", yet the above posts talk about creating a diconnected service. My higher number LOD (e.g. 20, 21, 22, 23) have empty folders in them. Is that because the cache for them has not been dynamically created yet. If I were to diconnect the 2D cache how could the 3D cache dynamically create those levels. Also is there a way to move 3D cache like you do 2D cache.
Monday, July 14, 2008 1:40 PM by Carol Fackler

# re: Creating a 3D globe cache from a 2D map cache

I refrenced the document above so users can understand the display and data caching mechanics of ArcGlobe. Please note that the above document refers to the ArcGlobe Destkop application and any exceptions mentioned there apply to ArcGlobe Desktop app. In any case, at the time the document was written (2004) Version 9.0 of ArcGlobe did not support full data cache generation of mapserver and ArcIms layers (which now it does). As to your other question, you state your globe cache seems to have higher LODs where it has some empty folders and you were wondering if the tiles were not yet dynamically created. yes that could be the case if you havent yet built the full cache. By 'if i were to disconnect the 2D cache' if you mean, if i removed the service that the 2D cache was based on, then, yes the 3D cache will not be able to generate any new tiles, and infact that could be the casue why those empty levels might have been created. Its always good practice, to generate the full data cache before disconnecting the 2D cache so as to not run into such issues. Regards,
Thursday, July 17, 2008 10:42 AM by Tam

# re: Creating a 3D globe cache from a 2D map cache

Carol, Regarding your question, <"...Also is there a way to move 3D cache like you do 2D cache…”>, the answer is yes. In fact 3D caches (globe caches) are self contained in that the cache contains a layer file that references the data cache. So what this means is that you can copy/move a cache from one machine to another and you should be able to compose a new globe document (Open up an empty globe doc, from the add data command in arcglobe, browse and find the cache you just moved and descend into the cache folder. There will be a layer file that can be used to load the cache).Now the new document you just created has reference to the cache you just moved from its new location. At this point all you need to do is save your new globe document and use it to publish a globeservice. Remember that now the document contains caches that are now' disconnected' in that any refrence to the source data is disabled.

This technique is useful if you have built the full data cache for your globe layers before you moving/copying it.

At verison 9.3, this has gotten even easier; you can follow the followign workflow to accomplish the same as above;

* Lets say you generated your cache on your staging server, called ServerX. On this machine, you have the Globe document that you used for publishing your globeservices, lets call it GlobeDocX, and the caches for all the layers in GlboeDocX were generated and stored in the server cache location, c:\arcgisserver\arcgiscache\GlobeCache, assuming the default location.

* Lets also assume you want to move your globe document, GlobeDocX and all related caches, from ServerX, to another machine (say your deployment server), serverY and start a globe service based on these.

At version 9.3, all you have to do is copy your Globe caches and Globe Document to your new arcgis server GlobeCache location and start the service. When the service is started ArcGIS Server will inspect the content of the doc and start it in a disconnected manner if the data sources are not available. Continuing from the above hypothetical setting, here is how you'd do it:

* Move/Copy all your globe caches created for GlobeDocX to your new servers cache location, lets say ServerY, by default again its cache location will be @ c:\arcgisserver\arcgiscache\GlobeCache

* Copy the GlobeDocument, GlobeDocX, anywhere to your new Server (you can store it along with any other map/globe documents you may have).

* publish a new Service based on the document you just copied.

* When you start the service, ArcGIS server will inspect the globe document you just moved from ServerX, and determine if each layer has a corresponding data cache available for it in the data cache location defined for that service (in our case in the default cache location). If so, it will start the service in a disconnected manner.

Note, Arcgis server will make the decision about starting the service in a disconnected manner or not depending on the availability of the source data used to build up the Globedoc and cache (in the above example, it will start disconnected if source data for layers of GlobeDocX are not available on ServerY - these could be layers referencing an ArcSDE data, a mapserver or for that matter even a local data source that are not visible/available on ServerY). This enhancement, on the fly detection/inspection of the globe document to determine if there are caches available for it and start the service in a disconnected manner, is available with ArcGIS server 9.3.

Previously (at version 9.2) it would fail to start a service if you simply just copied the globe doc from one machine to another and the data sources were not available in the new setting. Now (at 9.3) it would evaluate to see if it can start it in a disconnected manner, just feeding off from the cache.

I hope this answers your question about migrating/moving 3D data caches from one machine to another.

PS If you intend to do this (move/copy the cache from one machine to another) you should not change the auto generated folder cache names (the layername+Unique Ids given for each cache). Also this feature is currently available only for globeservices.

Thursday, July 17, 2008 11:51 AM by Tam

# re: Creating a Disconnected Globe Service

If I create a disconnected 3D cached service will I be able to use the Identify task on that Layer?
Thursday, December 04, 2008 3:32 PM by Carol Fackler

# re: Creating a Disconnected Globe Service

I'm assuming the answer to my post above (Dec. 4th) will be no - it makes sense. One note of interest. The identify on our 2D caches were awful. Especially the point and line layers. They seemed to work randomly. Once we created 3D cashe the point and line layer identify was much more reliable. I guess I could go through the effort of disconnecting the cache to see if the identify would work but I'd be very surprised if it did.
Tuesday, December 09, 2008 10:46 AM by Carol Fackler

Leave a Comment

(required) 
required 
(required)