Related Plugins and Tags

QGIS Planet

Colour shortcuts in QGIS 2.4

Quick poll… what’s the most frustrating thing about GIS? Fighting with colour plotters? Trying to remember GDAL command line syntax? MapInfo’s new ribbon interface* [1]? All of the above?


It’s getting a colour from here:


…all the way over to here:


Since the dawn of GIS humanity has struggled with this simple task* [2]. We’ve come up with multiple techniques for solving this problem, ranging from the RSI inducing “select and copy red value, alt-tab, paste, alt-tab, select and copy green value, alt-tab, paste, etc….” method, through to chanting “70, 145, 160… 70, 145, 160… 70, 145, 150… 70, 145, 150” to ourselves as we frantically try and rearrange dialogs to find the destination colour picker, all the while avoiding strange looks from co-workers.

Fortunately, QGIS 2.4 is coming to the rescue! Now, you can right click on any of QGIS’ colour picker buttons for a handy copy/paste colour shortcut menu. Pasting colours works from a whole range of formats, including hex codes, color names, and css-style “rgb” and “rgba” strings.


Problem solved!

Even better, you can just drag colours from one colour button to another:

Fixed again...

… and solved again…

Or, drag a colour from GIMP and drop it onto a QGIS colour button:


… and yet again!

Or even drag a colour from a QGIS button directly onto a shape in Inkscape! All this win is coming your way in QGIS 2.4, due June 2014.

[1] Pre-empting the inevitable flood of complaints when this new interface is rolled out
[2] I assume

Editing Labels in QGIS SVG Output using Inkscape

If you are planning to tweak the labels in SVG output from QGIS, you should use the old labeling engine. Labels create with the old engine are written into the SVG file as text objects whereas labels from the new engine end up as paths for some reason.

Let’s see how it works using the climate Shapefile from QGIS sample data. I just created an empty map, loaded the points and labeled them before exporting the map to SVG using Print Composer. Now, we can manipulate the SVG file in Inkscape: Select one of the labels and and start the XML Editor (Edit menu – XML Editor or through the toolbar button).

Find the "XML tree" button for full control of the labels

If you selected a label before opening XML Editor, one of the entires in the tree should be highlighted. Expanding the element reveals that it’s a text featuring a series of attributes QGIS exported. From here, you can change both the looks and the text of all labels in your map. Of course, you are not limited to the XML Editor but can change to the GUI – which is certainly recommended for experimenting with all the different settings.

Here you have full control over how the label looks like

  • Page 1 of 1 ( 2 posts )
  • inkscape

Back to Top

Sustaining Members