What is the cause for the degradation of environment?
Capitalism, corruption, consuming society? - OVERPOPULATION!
Please, save the Planet - kill yourself...

Tuesday, February 21, 2012

Speeding Up QGIS Rendering - a Workaround (sort of)

It is known that QGIS is painfully slow in redrawing canvas when at least one of the vector layers contains a lot of features. The obvious way to speed up the process is to forbid to render layer (or some of the features) at certain scale(s). Yes, it works, but what do we have to do, when we want to see the whole picture? To disable scale rendering and wait couple of minuets until the several hundreds of thousands features will be redrawn? Bo-o-oring!

The workaround that I use is not that elegant (as a rule based feature scaling for example), but it can be used in certain situations. When your vector layer is large but it is necessary to see all the features - start a WMS-server for this particular layer. Raster renders a way more quickly and will be generated by different software. Taking into account that the layer is on the same machine or in the local network the speed increase will be magnificent.

So you produce WMS-layer from the needed layer (lets call it parent-layer) by WMS-sever of choice (I use GeoServer because it has a straightforward GUI that allows you to set up server and WMS-layer in minuets), add it in QGIS and place it under the parent-layer. Then set visibility of the parent-layer to the larger scale (that is suitable for editing). Now you will be able to see the whole picture at the small scale, and rendering still will be fast. And because WMS-layer is produced from the same layer all of the committed changes to the parent-layer will appear at WMS-layer immediately.

And you will have another thing to decide: whether to create the same [complicated] style for WMS-layer as for parent layer or not. Well, I do not bother)))
Small Scale
Large scale

No comments :

Post a Comment