In QGIS, I need to place road numbers on a map (they are point labels) in solid rectangular boxes to make them stand out. Ideally they need to be the same colour as the road they refer to, so a motorway number should be in a blue box because the motorways are blue etc.

The boxes also need to scale with the label size, as some roads are for example 'A9', whereas others are 'A4567'. The roads and their labels have codes defining their type so this could be used to set the colours.

Is this possible?


Of course. You can easily overlay points with SVG-Symbols or geometries of different colors and shapes (rectangles, squares, circles,...). However, if i am right, it is not possible to apply colors based on attribute table values to those symbols. Therefore any solution depends on some categorization effort by hand (mouse :-) ) After you've get your symbols you could simply put labels of varying size (maybe create an attribute table field for that) on your symbols.

Search for OSM (openstreet map) symbols and similar graphics for some additional eyecandy.

  • Thanks for the answer? Can i add custom SVG symbols? If so how? – ElendilTheTall Jan 3 '13 at 23:06
  • well, you could use the style manager to import SVG images. Afterwards they should be available. Or you could click on the dotted button and chose a custom path to your symbol. SVG images can be created with Inkscape and other software. – Curlew Jan 3 '13 at 23:31
  • Would it be possible to do something with data-dependent polygons? I understand you can have, say, diagrams on the map. Could these be used to draw boxes around a point, sized to the number of characters in the label string? – ElendilTheTall Jan 4 '13 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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