I'm going through the QGIS Map Design book and have run up against a wall in adding cascading rules. I'm working with QGIS LTR 2.14. The authors recommend this version.

My vector data is in a SQLite db. I used ogr2ogr to convert it from the planet .pbf file.

I've created an extended subcategory rule from "motorway" called "motorway bridge" and used the following SQL to do so:

"other_tags" LIKE '%"bridge"=>"yes"%' OR "other_tags" LIKE '%"bridge"=>"viaduct"%'

This SQL yields a total of 6273 results. So far so good!

Now, I go ahead and right-click on that rule and select "Refine current rule" --> "Add categories to rule."

To create my level 1 bridge style, I use the following SQL, which should only run on the results in the parent filter; namely, only bridges.

"other_tags" NOT LIKE '%"layer"=>"2"%'

However, when I test this, it yields 118145 features, which means that it's clearly ignoring the parent query.

This may be a bug in 2.14; I'm inclined to say it is, otherwise, what is the point of using the "Refine current rule" function? Has anyone else run into this? I can write a whole bunch of explicit SQL to get around it, but wanted to make sure I'm not doing this wrong.

  • I think it's just the count test that's wrong - does it render correctly? – ndawson May 18 '17 at 19:47

So this has been open for a few days and I thought I'd answer my own question. @ndawson got it right in the comments: the features render correctly, it's just the count test that is wrong.

So, for what it's worth, if you're working with 2.14 and doing rule-based symbology, don't get too hung up on the count test!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.