[Marble-devel] Optimization tips
tackat at t-online.de
Fri Jan 4 14:06:25 UTC 2013
> 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 hope you are aware of the fact that Marble can load .osm files already and
that it has some more or less basic OpenStreetMap Vector rendering already.
You can either load them via File->Open in Marble, or in terms of programming
you open them like .kml files:
Just use a .osm file instead of the file.kml. See also
Have you tried this?
> 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.
Yes, the GeoPainter discards stuff that is not shown on the screen. It also
discards geometries that are too small to be drawn. We also do some
prefiltering for Polygon nodes and have some further optimizations in the
> 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.
Yes, if you load a bigger OpenStreetMap file into Marble (with Marble's own
parser) you'll run into similar issues at one point.
IIRC we try to reduce this by
* ignoring items that are too small to be rendered
* filtering out "less important" items
* and using the TileCoordsPyramid class (inside marble/src/lib)
This works to some degree already but can probably use some further
optimization. Maybe you could look into this even if you reuse our approach
Thibaut Gridel ("idis" on IRC) could maybe provide some further input on this
> 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
> Marble-devel mailing list
> Marble-devel at kde.org
More information about the Marble-devel