[Qgis-user] New plugin Dynamic Layers - Change layers datasource with variables

kimaidou kimaidou at gmail.com
Tue Oct 6 07:40:47 PDT 2015


Hi all,

I have just released the plugin Dynamic Layers which let you

* configure a "dynamic datasource" for any layer with variables. You can
use a syntax like {$myvar}
* Configure a table of variable values to use as replacements
* Use a vector layer as a source for this variables ( fields name must
correspond to variable names
* Define a layer as "extent layer" on which to zoom to full extent when
aplying variables

Then you can apply the variables on the configured layers to see the
changes in you project, and save the project if you want.

Use cases :
* You have some PostGIS layers with subqueries such as
table=(SELECT * FROM mytable WHERE country = 'France')

and you have data for the whole world. You can use the plugin to configure
a datasource such as
table=(SELECT * FROM mytable WHERE country = '{$COUNTRY}')

And then set the variable COUNTRY to 'Spain' or wichever country.

You can also change the path to shapefiles, such as
"/my/folder/mydata_{$COUNTRY}.shp"

A video is sometimes better than a description : https://vimeo.com/141541813

Source code here:
https://vimeo.com/141541813

Documentation in progress...


Any feedback welcome

Regards
Michaƫl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20151006/9f2f3a35/attachment.html>


More information about the Qgis-user mailing list