Select to view content in your preferred language

RasterElevationSource load() function seems to be a blocking call (completely freezes application)

527
3
10-09-2024 08:59 AM
Labels (1)
imbachb
Regular Contributor

Our RasterElevationSource consists of around 3k DTED files. When we call the ElevationSource's load() function we notice that the application freezes for around 10 seconds. In our application we'd like to be able to switch between different maps using different ElevationSources. Each time we load the ElevationSource, the application comes to a complete halt.

The code to load the RasterElevationSource looks like this:

auto surface = new Surface(parent);

auto rasterFilesPaths = getRasterFilesPaths(filepath); // returns around 3k raster files
auto elevationSource = new RasterElevationSource(rasterFilesPaths, surface);
surface->elevationSources()->append(elevationSource);

auto start = std::chrono::high_resolution_clock::now();
elevationSource->load();
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(stop - start);
qDebug() << "Loading elevationSources took " << duration.count() << " s";

Which in our case prints "Loading elevationSources took 11 s".
This gets especially bad when switching between maps with different ElevationSources. In this case the application completely freezes for half a minute and more.

Is there anything we can do to improve performance?
We also created a mobile mosaic dataset with the 3k DTED files which seems to perform quite well when added as a RasterLayer to the map. However, as far as we know, it's not possible to supply the  MosaicDatasetRaster directly to the RasterElevationSource.

0 Kudos
3 Replies
JaredCaccamo
Esri Contributor

@imbachb I took one of our internal tests to try and reproduce the behavior you are mentioning but the only time I saw any meaningful slow down/freeze was when I was providing a really large amount of DTED files, I was in the 20,000+ range. When I did my system resources were getting hammered, CPU usage was at 100%.

Can you confirm if your system resources are under stress? Could you also provide your system configuration? How much data is being loaded in those DTED files(MBs/GBs?)?

 

Cheers,

Jared

imbachb
Regular Contributor

@JaredCaccamo Thank you for looking into this. 

Our 3261 dt2 files are in total 72.8 GB large.

Our system configuration:
Windows 10 64 bit
Intel(R) Xeon(R) W-2225 CPU @ 4.10GHz (8 CPUs)
64 GB Memory
AMD Radeon RX 6600
1TB SSD

I've attached a video of the occurrence of the freezes. It also (sometimes) happens when changing the scene of a scene view, and only if the scene has a raster elevation source set. If it does not have a elevation source then the freezes between scene changes do not happen.
In the console window you can see how long the initial `elevationSource->load()` operation took. You can also see how long the `m_sceneView->setArcGISScene(scene)` operations took.I wrapped the operations with chrono time measurements:

 

auto start = std::chrono::high_resolution_clock::now();
m_sceneView->setArcGISScene(mapMetaData.scene());
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(stop - start);
qDebug() << "Setting new ArcGISScene took " << duration.count() << " s";

 

In the video the initial elevationSources load operation takes 6 seconds. Then two scene changes take 12 seconds each.

Looking at MB/s disk usage, during loading the usage didn't really go much over 0.5MB/s.

0 Kudos
JaredCaccamo
Esri Contributor

@imbachb Thank you for providing that information about your application.

Given the number of DTED files and total size of data, the performance you are experiencing is to be expected. 

Like you mentioned creating a mosaic dataset with the DTED files is the correct approach when using a raster layer but as you noticed, raster elevation source does not work with mosaic dataset.

If your app is online or can connect to ArcGIS Online or a portal, you could try and create an image service from the mosaic dataset. Then create an ArcGISTiledElevationSource from the service and use this elevation source.
There is a requirement for the image service to work as elevation source. The image service must support the Limited Error Raster Compression (LERC) tile format.

Here is some information on image service, https://developers.arcgis.com/rest/services-reference/enterprise/image-service/

If your app must be offline, you could try to create TileCache from the image service. Then use Tiled elevation source with the tile cache.

0 Kudos