This recipe is all about making your map unique by creating custom icons, north arrows, or even fill patterns.
You will need a vector illustration program (for example, Inkscape or Adobe Illustrator).
Don't have one? There are several free and open source options available on all platforms. Many people in the QGIS community use Inkscape (http://inkscape.org), but you can also use LibreOffice Draw or OpenOffice Draw. The most common proprietary software equivalent is Adobe Illustrator.
You will also need a text editor, such as TextEdit (Mac), Notepad, Notepad++ (Windows).
.svg file..svg file in a text editor, search and find the style line of your object, and replace it with the following lines:stroke-width="param(outline-width) 1" stroke="param(outline) #000" fill="param(fill) #FFF"
The before-after scenario when this code has been incorporated is shown in the following table:
|
Before |
After |
|---|---|
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:"param(fill) #000000";fill-opacity:1;stroke:"param(outline) #ff0000";stroke-width:"param(outline-width) 4";stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect3336"
width="301.61023"
height="308.96658"
x="30.651445"
y="725.00476" /> |
<rect
stroke-width="param(outline-width) 1" stroke="param(outline) #000"fill="param(fill) #FFF"
id="rect3336"
width="301.61023"
height="308.96658"
x="30.651445"
y="725.00476" /> |
.svg file that you previously created.
The special text that you add to the .svg file is a marker or placeholder. QGIS looks for these particular words and then utilizes them to insert symbol changes on-the-fly as the SVG is read into the program.
While this recipe demonstrated a very simple SVG, this method applies to more complicated symbols.
Also note that in Settings | Options | System, you can set paths to folders of SVGs so that all of them will be available in the symbology dialogs all the time.
QGIS also lets you customize fill patterns using SVG symbols. The QGIS Training Manual has a good example of this at http://docs.qgis.org/2.8/en/docs/training_manual/basic_map/symbology.html#hard-fa-creating-a-custom-svg-fill.