I am mapping animals and have to display their locations in QGIS (2.12.3, Win7 64) with gender symbols (♂/♀). The outline of the symbols should be rendered in different colors corresponding to the dates of survey. The filling should be either colored or transparent respective to classes of behavior. So I generated the svg symbols with INKSCAPE and then replaced the whole „style“-line in the svg file text

style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:10.00027084;… … ...“


fill="param(fill) #000" fill-opacity="param(fill-opacity) 0.0" stroke="param(outline) #000" stroke-width="param(outline-width) 3"

In QGIS I used attribute-driven rendering for the outline (attribute field “color“) and an expression to choose between either transparency or fill (case when “behav“ <> '+' then '0,0,0,0' else “color“ end)

The outline, both color and width, was displayed as I intended. In contrast, I had no control over the fill. Sometimes all symbols were filled, no matter what the attribute says, sometimes all fillings remained transparent and in the third case the symbols that should be transparent had a black (or white) fill. When I closed and reopened QGIS, the rendering of all fills changed sometimes. The outline, however, was displayed correct all the time.

Instead of '0,0,0,0' in the case-when expression above I experimented with other statements, e.g. '#000000 0.0' or 'default' to achieve correct rendering of color or transparency, but without success. I also varied the default values in the “param(…)...“ statements and omitted the whole “fill-opacity...“ statement. Again without gaining control over the fill.

In addition, it was strange to see that sometimes the fill of all symbols changed from transparent to color or vice versa when I varied the outline width. I then introduced fill-rule=”evenodd”, but again without visible effect.

I have no idea what's wrong.

2 Answers 2


I have faced problems in QGIS when I have been using somewhat complicated expressions, they just don't seem to work like they should.

You might be better off just using Rule Based Styles, you can set Rules to define which symbol to use based on the columns you have (Gender and Year) by applying filters, then you can the customize the applicable symbol in the style manager (you should be able to edit the fill and transparency of the symbols with no issues, and be able to save the symbology)


All parameters (fill="param(fill)) should be without values, example of svg:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="300" viewBox="0 0 250 400">
    <polygon points="185 350 125 310 65 350 65 190 122 50 128 50 185 190 185 350" fill="param(fill)" fill-opacity="param(fill-opacity)"  stroke="param(outline)" stroke-width="param(outline-width)" stroke-opacity="param(outline-opacity)"/>
    <line x1="125" y1="180" x2="125" y2="50" stroke="param(outline)" stroke-width="param(outline-width)" stroke-opacity="param(outline-opacity)"/>
    <circle cx="125" cy="190" r="10" fill="param(fill)" fill-opacity="param(fill-opacity)" stroke="param(outline)" stroke-width="param(outline-width)" stroke-opacity="param(outline-opacity)"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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