[Qgis-user] Rule based style dependent on selection in another layer

magerlin MAP at ramboll.dk
Thu May 14 15:20:08 PDT 2020


I have two layers: "Bus routes" and "Bus stops" with a common attribute
"Sampled_Route".

As many bus routes drive on the same road a lot of features are on top of
each other. I will like to be able to "Scroll through" my data for QA using
the Go2NextFeature plugin and only show the selected bus route and the stops
used by that route by setting up rule-based symbologies.

For the "Bus routes" layer the rule is simple: is_selected()

But I cannot make it work to only show bus stops with attribute
"Sampled_Route" equal to the value of "Sampled_route" in the selected "Bus
route" feature.

I try this as a rule in the symbology for the "Bus Stops" layer: 
First step is to point at the right feature in "Bus Routes": 
get_feature('Bus Routes', 'Sampled_Route', "Sampled_Route"). This works well
as far as I can see - a value of one is returned. 

But when I then try to check whether this feature is selected: 
is_Selected(get_feature('Bus Routes', 'Sampled_Route', "Sampled_Route"),'Bus
Routes') 

I get the error message "Eval Error: Cannot convert to feature"

Any inputs?



-----
Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html


More information about the Qgis-user mailing list