Offline 3D Scenes and Layers

1295
7
03-29-2019 02:52 AM
AbhijeetSatam
New Contributor III

I am referring to example code given at https://developers.arcgis.com/qt/latest/cpp/guide/build-a-new-scene.htm link.

Here in the code segment, two classes are called – Scene and ArcGISTiledElevationSource.

My understanding is that, constructor of both these classes fetch data from internet.

My requirement is to store some offline package locally and use it to render scene and apply elevation source.

Can anyone let me know how can we possibly achieve the same? 

Related queries that I have are:

1. What is equivalent of Mobile Map Package for Scenes? Or can I use Mobile Map Package and display the same as a scene? If yes, how to achieve the same? 

2. Elevation source can it be pre-applied while creating Mobile Map Package or equivalent. 

Thanks.

0 Kudos
7 Replies
LucasDanzinger
Esri Frequent Contributor

Hello,

Good news - our next release of ArcGIS Runtime (100.5) will support Mobile Scene Packages to view 3D content completely offline. The release will be available in the first week or two of April 2019. Here is a preview from our dev branch in github showcasing how to use the new API - https://github.com/Esri/arcgis-runtime-samples-qt/tree/v.next/ArcGISRuntimeSDKQt_CppSamples/Scenes/O...

You can package the elevation source directly from Pro into the Mobile Scene Package so that it is very simple to open the package, obtain a Scene, and then add it to the view, and all of the layers, elevation, etc will be carried over automatically.

Thanks,

Lucas

0 Kudos
AbhijeetSatam
New Contributor III

So, in the meanwhile, is it possible to achieve similar offline functionality using 100.4? 

Also, with 100.5, how would one be able to create Mobile Scene Packages in ArcGIS Pro? Where is that feature available in ArcGIS Pro?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Here is the documentation on creating a mobile scene package - https://pro.arcgis.com/en/pro-app/help/sharing/overview/mobile-scene-package.htm

In the mean time, you can programmatically build up a scene with its layers in code. For example, here is the code from the help with offline equivalent

// Create a scene using a TPK BaseMap
ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(QUrl("pathToData/basemap.tpk"), this);
m_scene = new Scene(Basemap(tiledLayer), this);

// Create a new elevation source
const QString montereyRasterElevationPath = "pathToData/MontereyElevation.dt2";
RasterElevationSource* elevationSrc = new RasterElevationSource{QStringList{montereyRasterElevationPath}, this};
m_scene->baseSurface()->elevationSources()->append(elevationSrc);

// add a scene service with ArcGISSceneLayer from SLPK
m_sceneLayer = new ArcGISSceneLayer(
            QUrl("pathToData/lyrPkg.slpk"));
m_scene->operationalLayers()->append(m_sceneLayer);
0 Kudos
AbhijeetSatam
New Contributor III

Thanks Lucas.

As per your suggestion we tried to build and execute the OpenMobileScenePackage from github site esri/arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Scenes/ after installing Runtime 100.5.

It would build correctly but wont execute. Throwing the following runtime error:

QML debugging is enabled. Only use this in a safe environment.

14:56:14: The program has unexpectedly finished.

14:56:14: The process was ended forcefully.

I tried to debug this and it would point me at the following line in main.cpp:

  QGuiApplication app(argc, argv);

Can you suggest a solution?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

That's a tough one to diagnose. Hard to say what the problem is. Do any of the samples work for you on that system? Can you try creating a new template app? I am wondering if something is not setup correctly in your environment?

0 Kudos
AbhijeetSatam
New Contributor III

Tried to create a new template app but the problem re-occurs. None of the samples compiled are able to execute.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

In that case, sounds like something is likely not quite right in your environment. Have you gone through the install and setup guide documentation? https://developers.arcgis.com/qt/latest/qml/guide/install-and-set-up-on-windows.htm

It might be good to verify you have the correct MSVC compiler version as well as the proper OpenSSL version.

0 Kudos