Creating Offline Maps to be loaded in Unity

545
6
02-28-2024 11:25 PM
paolo72
New Contributor

I've recently started using arcGIS Pro (version 3.2) and I’m trying to understand the correct procedure for creating offline 3D maps with ArcGIS Pro, which
I can then use inside Unity instead of the maps currently in use.

Currently, in Unity, I use a base map and the elevation layer loaded as follows:

arcGISMap.Basemap = new Esri.GameEngine.Map.ArcGISBasemap(Esri.GameEngine.Map.ArcGISBasemapStyle.ArcGISImageryStandard, APIKey); //no labels on the map

arcGISMap.Elevation = new Esri.GameEngine.Map.ArcGISMapElevation(new Esri.GameEngine.Elevation.ArcGISImageElevationSource("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", "Terrain 3D", ""));

And everything works.

I’ve noticed that if I create a global scene project with ArcGIS Pro, I get a similar result by selecting “World Imagery” as the basemap.

What I’d like to do is create offline maps from this project in ArcGIS Pro that I can bring into Unity.

Is this possible?

Alternatively, what could be a sensible approach to achieve the desired result?

Thank you for your help!

0 Kudos
6 Replies
WesleyO
Esri Contributor

Hi,

I don't think it is currently possible to bring an entire 3D map offline into a single file and import it into Unity. But you can bring the different components of your 3D map from ArcGIS Pro offline. These docs provide more information on accessing the layers locally as well as the different methods to create the local files (which includes ArcGIS Pro):

Scene Layers:

Elevation:

Basemap:

 

0 Kudos
paolo72
New Contributor

Hi,

Thank you very much for the suggestions.

I managed to download the basemap in .tpkx format and the elevation in .tpkx format, and I tried to import them into Unity. Unfortunately, without success.

I used the following instructions:

arcGISMap.Basemap = new Esri.GameEngine.Map.ArcGISBasemap("c:/Users/admin/Documents/ArcGIS/Projects/Mappa2DCourma/filename.tpkx", ArcGISLayerType.ArcGISVectorTileLayer, APIKey);

arcGISMap.Elevation = new Esri.GameEngine.Map.ArcGISMapElevation(new Esri.GameEngine.Elevation.ArcGISImageElevationSource("c:/Users/admin/Documents/ArcGIS/Projects/Mappa2DCourma/ExportedElev/elev.tpkx", "Terrain 3D", ""));

The map is not loading.

I checked the API Key and it is correct

Using the additional ArcGISViewStateLogging Component i see that during loading procedure i get the error message:

"ArcGISViewState changed to : NoViewport, Error (Invalid request response.)
Additional info: No sources found in archive at 'c:/Users/admin/Documents/ArcGIS/Projects/Mappa2DCourma/filename.tpkx'

But i don't know what it means.

Thank you for any further suggestion

 

0 Kudos
WesleyO
Esri Contributor

Hi,

If you are referencing a .tpkx file for your basemap, your ArcGISLayerType should be ArcGISImageLayer.

 

In order to use a ArcGISVectorTileLayer for your basemap, you must download your basemap into a .vtpk file (documentation).

0 Kudos
paolo72
New Contributor

Hi,

Thank you for the suggestion; I got confused…

Now the basemap is loading correctly.

Regarding the elevation layer, I followed the procedure outlined in the link below:

https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/tile-package.htm#GUID-853C5B89-8C83-4...

and generated a .tpkx file.

I tried using both the ‘Terrain 3D’ layer and the ‘Terrain 3D (for Export)’ layer as input, which seems to be the most suitable according to this link:

https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4

When I try to load it in Unity, I don’t receive any error messages, but the layer doesn’t load.

If I load elevation layer from remote source, everything works

arcGISMap.Elevation = new Esri.GameEngine.Map.ArcGISMapElevation(new Esri.GameEngine.Elevation.ArcGISImageElevationSource("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", "Terrain 3D", ""));

this is the instruction i use to load locally stored data

arcGISMap.Elevation = new Esri.GameEngine.Map.ArcGISMapElevation(new Esri.GameEngine.Elevation.ArcGISImageElevationSource("c:/Users/admin/Documents/ArcGIS/Projects/Mappa2DCourma/ExportedElev/elevation1403.tpkx", "", ""));

Is there anything else I can check?

Thank you again for your support.

0 Kudos
CodyBiles
New Contributor

Hi paolo72,

 

Did you happen to find a solution to this problem? I'm also working on a similar workflow and I'm stuck.

 

Thanks

0 Kudos
paolo72
New Contributor

Hi CodyBiles,

I’m sorry but I wasn’t able to find a solution for the elevation problem. 

At the moment, I use 2d base maps when I need to work offline 

regards

 

0 Kudos