ArcGISTiledElevationSource with an offline map

2165
8
Jump to solution
03-09-2021 11:24 PM
FatmaAkdemir
Occasional Contributor II

Currently we are using "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" for obtaining the 3d basemap. We want to download tiles or .tpk from this source. What is the correct way of creating an offline 3d map? If we want high resolution in our offline map, what should be the format? Would .tpk be enough?

0 Kudos
1 Solution

Accepted Solutions
LukeSmallwood
Esri Contributor

Hi @Anonymous User - you are correct, if you want to work with a self contained offline scene then a .mspk (a MobileScenePackage) is the way to go. That package contains all of the information that you need for your scene:

- basemaps

- elevation sources

- feature data

- scene layers

 

A .tpk (a Tile package) is tiled raster data that can be used for basemaps (e.g. an imagery layer) or elevation data as in the service above. A MobileScenePackage may very well contain a Tile Package for the basemap or elevation data so when you load the Scene all of that information is already set up for you.

 

At present, there is no API to take a scene offline in Runtime and create a MobileScenePackage - for that you need ArcGIS Pro. You can take certain individual layers offline to create a local data-set such as an elevation tpk but you would need to use that data to construct the Scene yourself. If you have a tpk for the elevation source in your scene then it should support getting the elevation at the user's clicked point.

Luke

View solution in original post

8 Replies
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir 

 

If you want to download an elevation source from that service you will need to make use of the for export version which supports exporting tiles. In terms of high resolution, that would depend on your particular use case - that data set includes tiles to LOD level 16: 

If you want to export the data, there are a couple of options:

 

Use the ExportTileCacheTask with the Runtime API. This will allow you to create a tpk which you can programmatically add to your Scene as an elevation source.

 

Use ArcGIS Pro with the "Download map" option to create a MobileScenePackage:

1. Make sure you are logged into AGOL

2. Create a new map

3. Add data by path > https://tiledbasemaps.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer

4. Zoom to desired area > Click Map Tab > Click Download Map

5. Select desired scales > click download

6. The layer gets added to the map so go ahead and copy it to a new global scene

7. Drag the layer into the ground elevation surface and remove the service

8. Remove any other services and create the mobile scene package

 

I hope that helps,

 

Luke

0 Kudos
FatmaAkdemir
Occasional Contributor II

Hi @LukeSmallwood,

Thank you for your help. The ExportTiles code example works perfectly with 2D maps, however I could not manage to download 3D map tiles with the example code. Is there any code example that is equivalent 3D version of "ExportTiles" ?

I did not try ArcGIS Pro since I don't have a license currently.

0 Kudos
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir, you can do this in Runtime using the 2D ExportTilesTask example but be aware that you won't see a basemap rendered for the elevation surface so you may need a different way to orient yourself so that you can take the area offline. Also be aware that Esri tiled services have a maximum number of tiles which can be requested when taking data offline so you may need to select a small area to get this to work. You also need to be authenticated to export tiles.

 

Once you have the tiles exported as a tpk you can use this to create a TileCache object which you supply to the elevation sources for your scene. Here is some example C++ code that I used to try this part out:

 

  auto tpk = new TileCache("~\\tpks\\elevation_source.tpk", this);
  ArcGISTiledElevationSource* elevationSource = new ArcGISTiledElevationSource(tpk, this);
  connect(tpk, &TileCache::doneLoading, this, [tpk, this](Error e)
  {
 
    auto cc = new OrbitLocationCameraController(tpk->fullExtent().center(), 500, this);
    m_sceneView->setCameraController(cc);
    m_sceneView->arcGISScene()->baseSurface()->setElevationExaggeration(8);
  });
  // add the elevation source to the scene to display elevation
  m_scene->baseSurface()->elevationSources()->append(elevationSource);

 

I hope that helps.

 

Luke 

0 Kudos
by Anonymous User
Not applicable

Hi @LukeSmallwood ,

I thought that when I wanted to download a 3d scene it should be .mspk not .tpk. What is the difference between these two? We also want to get the elevation information when user clicks a point on the map which is offline. Would .tpk include that information?

0 Kudos
LukeSmallwood
Esri Contributor

Hi @Anonymous User - you are correct, if you want to work with a self contained offline scene then a .mspk (a MobileScenePackage) is the way to go. That package contains all of the information that you need for your scene:

- basemaps

- elevation sources

- feature data

- scene layers

 

A .tpk (a Tile package) is tiled raster data that can be used for basemaps (e.g. an imagery layer) or elevation data as in the service above. A MobileScenePackage may very well contain a Tile Package for the basemap or elevation data so when you load the Scene all of that information is already set up for you.

 

At present, there is no API to take a scene offline in Runtime and create a MobileScenePackage - for that you need ArcGIS Pro. You can take certain individual layers offline to create a local data-set such as an elevation tpk but you would need to use that data to construct the Scene yourself. If you have a tpk for the elevation source in your scene then it should support getting the elevation at the user's clicked point.

Luke

by Anonymous User
Not applicable
Hi Luke, just a final question:
If I use .tpk instead of .mspk will I be able to get the elevation of
clicked point, and when I move the camera will I see the mountains etc
just like in a 3d scene?
0 Kudos
FatmaAkdemir
Occasional Contributor II
0 Kudos
LukeSmallwood
Esri Contributor

Hi @Anonymous User - To make an offline scene you really need 2 types of data:

- the elevation source which gives height to things in the scene

- the basemap which is draped over the elevation source to provide context

You would need a separate .tpk for each of those things - one for elevation and one for the basemap. If you have a scene which contains both of those data sources, you can click on a point and get the elevation back.

0 Kudos