5

I am working on a symbol set for Swedish road signs. I have batch converted some 300 png files to svg, and they work very well in QGIS.

Except for one detail: Only the top half of the symbol is visible in the symbol picker (the signs below are actually triangular and round). Looking at the code, these files are no different from other svg files in the symbol library. It makes no difference if I scale down the images.

Is there some svg parameter I need to add?

I used Imagemagick for the batch conversion, and QGIS is 2.18.4.

screen dump from QGIS symbol picker

  • I noticed in my QGIS 2.18.2 version that if load the style interface without selecting an SVG Group, my svg icons are more visible. If I select an SVG group, some of my icons are cut away similar to yours. Not sure why this occurs... – Joseph Aug 4 '17 at 12:35
  • 1
    can you post a link to one of your generated SVG files? There are a couple of road sign SVG sets available using Resource Sharing plugin, including a Swedish one (Swedish Trafikverket-riksintressen) Icons for the Swedish one doesn't appear at all in symbol viewer for me (the SVG files look fine otherwise). But the other 'Road Symbol' set doesn't have this problem. Comparing/checking the SVG files might help track down the problem. – Steven Kay Aug 4 '17 at 12:36
1

I am using 2.18.10 64 bit with exactly this problem, but now have a reason and solution.

I copied all the symbols displaying half only to another directory, and they were fine. Then I deleted all the original symbols in that directory, and the halves are back. Obviously, one of the symbols already in the directory was controlling the appearance, so as soon as that was deleted, the problem came back.

Second, when I added another symbol to the end of the directory displaying half symbols, they were all then fine (I added the tram stop). If I removed this, they all became half again. The last symbol in a directory appears to control the appearance of all of them.

You can probably just change the last symbol in a directory to get rid of the problem, but I changed all mine. Using Inkscape, look under document properties. Simply make sure that the document size has equal height and width, i.e. a square box. If the last symbol is a rectangle, with height less than width, all the symbols will be cut.

Of course, this does not affect the plotted symbol. It just makes selecting a symbol a bit harder... and annoying.

  • Thanks Richard! Good thinking and great troubleshooting. I will try your suggestions monday when I am back at the office. In the meantime, may I post some follow-up questions? How do you define the 'last' symbol? Can you control the order? As I do have rectangular signs, I could perhaps add a dummy square symbol 'last'. Last, why should one arbitrary symbol affect the display of them all? It seems pointless. Regards. Mats.E – Mats Elfström Sep 9 '17 at 11:43
  • Hi Mats. Thanks for your comments. I have now discovered/realised that because the graphics are scalable, they will always display with the highest ratio, i.e. any rectangle will cause problems. My solution was half correct and half luck. The best/only solution is to make all the SVGs square. In Inkscape, I make height and width the same, then use Align and Distribute on the selected item to put it in the middle of the square ( a nice touch, but not essential). As they are scalable, all the squares do not have to be the same size for all icons, so that makes the editing a bit easier. Rich. – Dr Richard Langford Sep 13 '17 at 5:13

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.