[Qgis-developer] refresh joined layers cache through python

Olivier Dalang olivier.dalang at gmail.com
Sun Mar 8 10:54:22 PDT 2015


Dear List,

I'm posting this to qgis-dev since I got no answer on qgis-user and it's a
bit technical.


I'm using layers joins in my projects, and need to use the memory cache for
> performance reasons.
>
> This means that when I'm making changes on the joined layers, they won't
> appear on the base layer until the project is reloaded.
>
> Is there a way to trigger a refresh of the joined layer cache "manually"
> through python ?
>
> I looked at the API, but didn't find how to do so...
>
> I found this class : *QgsVectorLayerJoinBuffer* which has a
> *createJoinCaches* method, but I couldn't find how to get a reference to
> it from the VectorLayer.
>
> There's also the *createJoinCaches* method of *QgsVectorLayer*, but it
> seem it has no effect if the cache was already created (and that's what the
> docstring says as well).
>
> If there's no way to do it, does anyone have a workaround, hopefully a bit
> lighter than reloading the project ?
>

Thanks a lot !

Olivier

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150308/6555b7bb/attachment.html>


More information about the Qgis-developer mailing list