[Marble-devel] Optimization tips

jean-charles.quillet at alyotech.fr jean-charles.quillet at alyotech.fr
Fri Jan 4 08:43:41 UTC 2013

>-----Message d'origine-----
>De : marble-devel-bounces at kde.org [mailto:marble-devel-bounces at kde.org] De la >part de Torsten Rahn
>Envoyé : jeudi 3 janvier 2013 14:15
>A) GeoPainter is relatively low-level painting (like QPainter). 

This is exactly what I'm doing.

>B) Another approach would be to treat the polygons/lines as objects. You can 
>either instantiate the objects via C++ code:
>So the second approach might be better if you want  best performance without 
>having to worry much about optimizations. But with the first approach you 
>might have better control over what you're doing and you could do the whole 
>bsp-tree / tilePyramid thing yourself in some way that is optimal for your use 

Interesting, didn't know about this approach.

>Do your thousands of polygons only cover a certain small area or are they 
>covered over the whole globe? What is the amount of nodes of a typical 
>polygon? Do you have to change the pen and brush frequently?

Yes my polygons cover a small area, like 100kmx100km. They have only a few nodes between 4 and 10. I'm getting these vectorial data from OpenStreetMap server, they are: buildings, roads, land areas, water areas etc... I dont change the painter a lot.

I know I can get better performances putting my data in a geometric data structure (like bsp tree as you said) to be able to draw only what's visible on on the screen. But it is not actually a problem in my application because when there is not much drawn on the screen, it's already running faster. I think the geopainter is discarding whatever is not on the screen.

So implementing this will only improve the performance when zooming but not when all the data is displayed. Maybe I could find a way not to draw what is too small to be displayed.

I know about bsp-trees but not the tilePyramid thing. It sounds interesting. Can you tell me more about this or give me some internet link ?


More information about the Marble-devel mailing list