Bug report #17793

Exporting SLD : "ELSE" rule doesn't export, making the style unusable

Added by Olivier Dalang about 6 years ago. Updated almost 5 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25689


Hi !

The "ELSE" rule in rule based symbology is extremely useful. But when exporting to SLD, the rule gets transformed to :

          <se:Name>A regular rule that works well</se:Name>
          <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
          <se:Name>All other features</se:Name>
          <!--Parser Error: syntax error, unexpected ELSE - Expression was: ELSE-->

So we get that <!--Parser Error...--> block instead of the whole <ofc:Filter> block.

This means that there's no filter for that rule, making it apply to all features, and thus making the map unreadable.

I don't know if SLD allows for something like "ELSE" ? If not, maybe we could just simulate it by using <ogc:Not> filter and putting all other layers conditions in there ? That may be a bit messy for complex rules... but would work well for simple ones, and would be consistent with what we do for rules groups.

Thanks !!


#1 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback

Please check if this issue is still valid on QGIS 3.4.5 or 3.6.

Also available in: Atom PDF