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.