[QGIS-Developer] Preview job and slow datasources

Matthias Kuhn matthias at opengis.ch
Wed Nov 15 08:11:00 PST 2017

On 11/15/2017 04:55 PM, Even Rouault wrote:
> On mercredi 15 novembre 2017 16:18:29 CET Matthias Kuhn wrote:
> So if the provider of one layer returns false in renderInPreview() that
> would disable the rendering of those layers in the preview images ?

Disabling only certain layers individually will help to get some cheap
layers show up to help with navigation.
>> or just blacklists some known-expensive types?
> The provider has not necessarily that knowledge. In my example, if you
> are very close to the server and have high bandwidth, preview jobs
> wouldn't be a bottleneck.
> Or there are cases like JPEG2000 where the CPU speed and number of cores
> can make a huge difference, so the knowledge of the GDAL driver isn't
> enough.

> So I'm wondering if just a per-layer timing logic in
> QgsMapRendererCustomPainterJob::doRender() wouldn't be enough.

Other factors that could be considered are things like how long it takes
to cancel an ongoing rendering job or how many free connections we have
in the pool.
E.g. in the case of a WMST, the time to build the image might be high
(as long as it's not coming from the cache) but it's worth preloading
and showing in any case.

More information about the QGIS-Developer mailing list