[Marble-devel] Performance issues adding placemarks to MarbleWidget

Martin Engelmann murphi.oss at googlemail.com
Tue Nov 20 19:40:03 UTC 2012


Hello,

I'm developing an application for managing geocaches and I'm using marble to 
display the locations on a map. I'm using a GeoDataDocument to colect all the 
placemarks for the caches. For each cache I use the following code to add a 
placemark to the map:

    Marble::GeoDataPlacemark* placemark = new Marble::GeoDataPlacemark();
    placemark->setName(geocache->waypoint());
    placemark->setCoordinate(Marble::GeoDataPoint(geocache->position()));
    // Set style, description and visual category ...

    marbleWidget->model()->treeModel()->addFeature(geoDataDoc, placemark);

The code works fine and fast when the application starts and the widget is not 
yet shown on the screen. The placemarks are created based on information from 
a database in a function called from the constructor of the applications main 
window.

When I change the path to the database file however I need to remove all 
geocache placemarks and repopulate the map with the placemarks read from the 
database. The map is shown as it is part of the main window. This is much 
slower on my machine.

I measured the follwing times for the addFeature call on my machine (Intel 
Core i7 CPU  860 @ 2.80GHz, 6GB RAM):
Startup of the application: 1.1ms
Repopulate the map: 28ms - 29ms

I assume it's slower because after each call to addFeature the map is updated 
to show the new placemark. Is there a possibility to disable updating the map 
when I add placemarks? 
This way I could disable updating before I start adding the placemarks and re-
enable it when I'm finished.


I'm using marble 1.4.1 and KDE 4.9.3 on ArchLinux x86_64.


Kind regards,
Martin Engelmann
murphi.oss at googlemail.com


More information about the Marble-devel mailing list