[Qgis-developer] Symbology api

Vincent Mora vincent.mora at oslandia.com
Fri Oct 3 04:10:03 PDT 2014


Hi all,

While thinking about the interface of categorized and graduated 
symbology with varying size (instead of color) I had an idea to reduce 
the code complexity in src/core/symbology-ng (~15% less code).

Since it changes the symbology API, I'd like your input on that:

At the moment we deal with categorized, graduated, rule-based and single 
symbol with different classes.

At the same time the single symbol allows to use expressions for all 
symbol properties.

We can use expressions to make the single symbol layer behave:
- graduated : properties are continuous functions of attributes,
- categorized or rule based : properties are discrete function of 
attributes

The user interfaces for categorized, graduated, rule-based could remain 
the same, it's just that it would generate the expressions for the 
single symbol instead of configuring as specific class. Several 
categories could be defined to affect various parameters (color and size 
are the first use case).

Can you tell me if the idea is sound ?

V.



PS: (implementation detail)

Data defined properties are treated as a special case in the symbology 
classes.

Since a constant is a valid expression, why not avoid this special 
treatment and have properties being always expressions in the symbology 
classes ?


More information about the Qgis-developer mailing list