Elevation can help with 3D visualizations by creating relief in your 3D scene. Elevation surfaces define height values across the extent of a map or scene. Other layers are usually draped on top of the elevation. In most cases, data for an elevation layer comes from an elevation service. Currently, tiled elevation layers are supported in the LERC format.
The following types of source URLs can be used to add an elevation layer and create relief in your ArcGIS Map:
- Item page URL
- Elevation service URL
Elevation tiles can also access data from LERC encoded tile packages stored locally.
A tile package is a single .tpk (or .tpkx) file containing tiles, and you can share the file as you would with any file. Compared with .tpk files, .tpkx files provide better performance on network shares and cloud store directories. The spatial reference of the elevation should match with the basemap and image tile layers. See Spatial references for more information about coordinate systems.
When you have multiple elevation sources, the last item added to the collection takes precedence and is displayed topmost in the Map Creator UI. You can apply mesh modification to remove or change the altitude of specified polygon areas to the elevation surface that is defined by elevation sources.
Set elevation
The Terrain 3D from ArcGIS Online and its spatial reference is Web Mercator (Auxiliary Sphere).
To use the default elevation source, click the Elevation tab, and select Terrain 3D.
To use custom elevation sources:
Click the Elevation tab, and select the Default Elevation or select Custom Elevation to set a custom elevation source in the panel.
- Click + Add New at the bottom right in the Elevation panel to open the pop-up window.
- Enter the online service URL for the elevation service or a local file package path in the Source field.
- Add the name of the source in the Name field.
- Click Add.
- Find the newly added elevation source in the Elevation panel.
- To use a
.tpk
or.tpkx
file package as an elevation source, use the absolute file path for the Source. - To change the elevation source order, click ⋮ and select Move up or Move down.
- The elevation source at the top of the list has the highest priority.
- To change an additional elevation source name, click ⋮ and select Rename.
- To zoom the Scene view camera to the extent of an additional elevation source, click ⋮ and select Zoom To.
- To delete an additional elevation source, click ⋮ and select Remove.
- To disable elevation, remove the checkmark from Enable All.
- To use a privately hosted elevation layer, select the matching configuration from the Authentication drop-down list. For more information about using private content, see user authentication.
- Click the game object that has ArcGIS Map component attached in the Hierarchy window.
- Expand the ArcGIS Map Component, then the Elevation section in the Inspector window.
- Click the + icon at the bottom of the section.
- Enter the elevation source name in the Name field.
- Enter the online service URL for the elevation service or a local file package path in the Source field.
- Check the Is Enabled checkbox.
To use a privately hosted elevation layer, select the matching configuration from the Authentication drop-down list. For more information about using private content, see user authentication.
To add additional elevation sources:
- Click the + icon at the bottom of the Elevation section in the Inspector window.
- Expand the newly added item row.
- Change the Name and Source field values.
- Check the Is Enabled checkbox.
- To change the elevation source priority order, click = next to the triangle icon and move the item up or down.
- The elevation source at the bottom of the list has the highest priority.
- Click the triangle icon on the left to expand an elevation source registry and see the properties.
- To change an elevation source name, enter a new name in the Name field.
- To replace an elevation source URL or file path, enter a new value in the Source field.
- To hide an elevation source, uncheck the Is Enabled checkbox.
Use ArcGISImage
for the tiled elevation layer as elevation sources.
To set one elevation source, set the elevation directly to ArcGISMap
. To use multiple elevation sources, register each elevation source to Elevation
.
To disable an elevation source:
arcGISMap.Elevation.ElevationSources.At(arcGISMap.Elevation.ElevationSources.IndexOf(Elevation_2)).IsEnabled = false;
To remove an elevation source:
arcGISMap.Elevation.ElevationSources.Remove(arcGISMap.Elevation.ElevationSources.IndexOf(Elevation_2));
You can find the sample code to set an elevation source using a layer service URL in the SampleAPIMapCreator.cs file. The sample script file is in:
Assets/Samples/ArcGIS Maps SDK for Unity/[version]/Sample Content/Scenes/Scripts/APISample/
Refer to FAQ for troubleshooting data loading issues.