Saturday 18 March 2017

qgis - Can qgis2web display rule-based layer style?


I’ve just made a map that has two layers: one that contains the polygons and other that contains points. For the last one, I used rule-based symbology where I define the size and colour of the points by the following rule structure:


If  “X”(string) = 'a'  and   "Y"(real) <= 0.04   and   "Y" > 0.03 

enter image description hereenter image description here


The problem is that when I try to export it using Qgis2web the layer points disappear no matter if a use Openlayers or Leaflet.



enter image description here


I’ve changed the rule-based symbology and used a simple one. That just worked so I deduce that rule-based symbology and qgis2web don’t get well togheter.


enter image description here


I found here that the rule-based renderer is tied heavily to Qgis expressions, and only a small subset of Qgis expression functions are so far supported in Qgis2web.


I wonder if is there any possible way that I can use my first style layer and not the simple one to export it.


By that I mean, a different rule expression allowed in qgis2web that gives the same result layer, a different way in qgis to recreate my different point size and colour layer that’s also complatible with the qgis2web pluggin, or even any other pluggin that I can use to export my rule-based symbology layer.



Answer



Please preselect your layer with "X" = 'a' and export this selection as a new layer. Then go on with your rule-based renderer on this newly created layer which will be supported in qgis2web: enter image description here


The ruleset of this working prototype might be similar to yours: enter image description here


rule based rendering works fine in leaflet and openlayers



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...