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.– dmh126Commented Apr 11, 2016 at 15:21
-
Thanks Jochen, you saved my day. Simple line and this does the trick. I got 200+ different road sign symbols displayed on my map at once.– Tuomo H.Commented Mar 21, 2019 at 19:52
1 Answer
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):
And then:
Unfortunatly I have the German version, hope this helps as well.