[Qgis-developer] isSelected expression operator - Request for comments

Luigi Pirelli luipir at gmail.com
Thu Jun 4 07:45:50 PDT 2015


Hi at all,

I just added a feature request: https://hub.qgis.org/issues/12879
regarding adding a isSelected (or something else) operator in the
expression editor.

I ask the community to comment this request to find the best solution.

the idea in the request is here reproduced:

Many times, I received the request to have a smart styling for
selected features.
The main reason is to have a "smart" visualization of selected feature
is in case of:
* they are too crowded
* if would be necessary to have a special style for selected feature
(e.g. highlight the selected and blur the others)

In this moment styling of selected feature is:
1) limited to color and transparency setting
2) can be styled adding custom function that retrieve if the feature is selected

the solution 1, obviously, does not satisfy requirement
the solution 2 has two drawback:
A) the custom function have to know the layer id (blocked in the
expression) to get selected features and check if the current feature
is selected or not
B) the loop described in A is really time consuming with a large
amount of features

during Nodebo, Andreas and Nyall confirmed that there is no other way
to style selected features

How to solve technically:
I asked to Martin if were possible to add some kind of "contextual"
operator that allow the feature knows at what layer it belongs to (and
something more)... Martin said that, going up to the layer data (not
thread safe), could introduce problems during MT rendering.
He points out that "is selected" state of the feature is already
available to the feature, and it should only be published.
He suggested to ask to Nyall to integrate this feature because he is
was working on styling in that moment (for 2.10)
Nyall pointed out that this feature can be added after 2.10 because we
were too near feature freeze, so it could be added for 2.12 and 2.11
dev version for testing.

this is the state of the art. regarding a sophisticated way to style
selected features

regards,

Luigi Pirelli

**************************************************************************************************
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Elance: https://www.elance.com/s/edit/luigipirelli/
* GitHub: https://github.com/luipir
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* Mastering QGIS:
https://www.packtpub.com/application-development/mastering-qgis
**************************************************************************************************


More information about the Qgis-developer mailing list