Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create some svg symbols for Qgis using Inkscape, those symbols must have attributes as described in the question. For the last two days, I have been experimenting as instructed by Sourcepole and mimicked some symbols came bundled with qgis that have desired attributes without any success.

Finally I experimented with the simplest form of symbol: I created an svg that contains only a circle in Inkscape and tried to modify it.

The original file (circle.svg) have this line:


I modified it into:

   style="fill:param(fill) #ffffff;fill-opacity:1;stroke:param(outline) #000000;stroke-width:param(stroke-width) 1.01988637;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"

Saved as circle_modified.svg and selected it as point symbol, but Qgis couldn't change all three parameters at the same time.

What did I do wrong or should do differently?

My system: Qgis 1.8.0 on Ubuntu 12.04 64 bit, Inkscape 0.48, Gedit 3.4.1 text editor.


share|improve this question
Cao Minh Tu, where i add those lines in the QGIS? – newGIS Jun 27 at 6:55
@newGIS: those lines are in .svg file when you open it in a text editor (e.g: notepad). – Cao Minh Tu Jun 27 at 7:19

To create SVG symbols with modifiable fill color, stroke color and stroke width in QGIS, you should replace the style attribute from the path element with these 3 attributes:

  • fill="param(fill) #FFF"
  • stroke="param(outline) #000"
  • stroke-width="param(outline-width) 1"

If you are using InkScape, after writing the new SVG file, edit the file and replace the entire line beggining with style:


with the following line:

fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1"
share|improve this answer
where i add those lines in the QGIS? – newGIS Jun 27 at 6:51

I've also wanted to do this since finding out how to add SVG symbols yesterday, but they were all black. The answer given by jgrocha works - I wanted to vote it up but having just joined the GIS forum, I need to get some reputation first!

I also found this page which confirms the answer: SVG SYMBOLS IN QGIS WITH MODIFIABLE COLORS

To have the possibility to change the colors of the marker, we have to add the placeholders ‘param(fill)’ for fill color, ‘param(outline)’ for outline color and ‘param(outline-width)’ for stroke width. These placeholders can optionally be followed by a default value:

<svg width="100%" height="100%">
  <rect fill="param(fill) #ff0000" stroke="param(outline) #00ff00" stroke-width="param(stroke-width) 10" width="100" height="100">


share|improve this answer
where i add those lines in the QGIS? – newGIS Jun 27 at 6:54

I am going to expand on this because it took me a while to get it working. Make your symbol and save it as an Inkscape SVG and open in text editor. In the bottom code block you will see; style="fill:#00a000;fill-opacity:1;stroke:#000000;stroke-width:1;(...)" Replace this line with; fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1" In my SVG files the style line appears for every entity or shape in the svg and replacing those lines didn't work for me; but doing it at the bottom on an Inkscape SVG worked. I tried my solution and the directions here on Optimized and Plain SVG formats but it didn't work, hope this helps. Inkscape 0.48, QGIS 2.12.0, NotePad++

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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