Based on this question: How to display different SVG icon in the same layer in QGIS is it possible to add multiple svg files in qgis to the same layer automatically based on attribute value? I have a world dataset and world flags svg files. Can I visualize the flags somehow automatically? (for example adding the path as attribute to each record?)

  • It can be done automatically only with python script I guess. – dmh126 Apr 11 '16 at 15:21
up vote 4 down vote accepted

Yes I think so. Any aspect of symbology in QGIS can be data driven, also the path to an svg symbol e.g. You don't even need an attribute holding the complete path, you might create an expression that derives the path from another attributes content (here attribute "the_land_of_the_flag"), say:

concat('the/path/to/my/svg/symbols/', "the_land_of_the_flag", '.svg')

giving

'the/path/to/my/svg/symbols/germany.svg'

for example.

Here is a screenshot where to access this feature (QGIS 2.14.1):

enter image description here

And then:

enter image description here

Unfortunatly I have the German version, hope this helps as well.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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