qgis2web
qgis2web copied to clipboard
Graduated polygon style with expression
Single symbol style when creating a map with graduated polygon styling. I suspect this is probably because I am using an expression to convert numbers stored as text to real (numeric)?
Can you upload project and layer? Only a small subset of expression functions have been written, but if it's not a spatial function, it could be easy to add in.
There you go, it's probably fairly common for people to use an expression with data joined from a csv because it always joins as text/varchar. The expression is just "toreal("field")". I suppose you could just convert the column data type with the field calculator and avoid this issue.
Ah, there's a another more fundamental issue. I don't think expressions in the "graduate on" field are supported yet. nor is toreal()
as far as I can remember, but the first issue is more problematic.
Only way around this I can think of at the moment is to switch to a rule-based renderer, and move the toreal()
call into the rule. I think that should work (if we add toreal()
).
Thanks Tom, I was making these maps for a colleague (though ultimately for our members) and decided to see how they would look as a web map. So it was purely by chance that I found out this didn't work. From what I can see the easiest work around is to just use the field calculator to create a new column (even a virtual one) with the figures stored as text converted to real and it works fine then.