[Qgis-developer] virtual fields

Denis Rouzaud denis.rouzaud at gmail.com
Mon Mar 3 06:49:19 PST 2014


Hi all,

I was wondering about the idea of being able to create simple views in 
QGIS, "views" in terms of database.
Often, I use views (in postgres) to be able to create labels, title, 
simple calculation or whatever and also to combine data from joined tables.

Somehow, all is already there in QGIS but in distinct features:
- joins which will add the fields of the joined table to the main table
- expressions are used in many places where views are meaningful: 
labels, styling, search, etc.
- field calculation

I was thinking that these features should be grouped and improved in 
what could be called virtual fields -- so basically a "live" field 
calculation without writing to the provider.

First, the idea would be to define virtual fields using expressions.

Then, it should be made possible to integrate the joined fields in qgis 
expressions without adding them to the current attributes (as it is now).
One way to to it could be a function: joinField( joinName, joinedFieldName)
Hence, the user would be allowed to choose which joined fields he really 
wants to be accessible in the layer.

I believe this is a deep refactoring of the fields behavior, isn't it?
This could be a chance to clean up the joins, which I believe are a bit 
messy now.

This is totally above my skills and somehow my available time, but I 
would have (a part of) funding for this.

What do you think of this idea?
Would it be "easily"achievable without breaking the API?
Would you be interested in taking part of the dev?

Cheers,

Denis





More information about the Qgis-developer mailing list