Bug report #6777

SVG symbol references

Added by Andreas Neumann almost 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Giuseppe Sucameli
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:15928

Description

If one loads a point layer, e.g. a postgis layer with point files, and assigns SVG symbols for these points (a SVG symbol from a central user specified repository) the symbol displays fine, saves fine in the project file. But on project load, the SVG symbols are not displayed.

So to me it seems more like a loading/display problem.

snippet from the legend file:

            <renderer-v2 symbollevels="0" type="singleSymbol">
                <symbols>
                    <symbol outputUnit="MM" alpha="1" type="marker" name="0">
                        <layer pass="0" class="SvgMarker" locked="0">
                            <prop k="angle" v="0"/>
                            <prop k="fill" v="#000000"/>
                            <prop k="name" v="/stadtplan/toilets.svg"/>
                            <prop k="offset" v="0,0"/>
                            <prop k="outline" v="#000000"/>
                            <prop k="outline-width" v="1"/>
                            <prop k="size" v="4"/>
                        </layer>
                    </symbol>
                </symbols>
                <rotation field=""/>
                <sizescale field="" scalemethod=""/>
            </renderer-v2>

The project also uses relative paths.

Thank you for having a look at it!

Associated revisions

History

#1 Updated by Jürgen Fischer almost 7 years ago

where does the absolute path in <prop k="name" v="/stadtplan/toilets.svg"/> come from?

#2 Updated by Andreas Neumann almost 7 years ago

This is saved from the same version that later reads the file. This was always like this in the past. QGIS should prepend the central repository path to this absolute path or alternatively locate the file in the central respository distributed with QGIS.

In my case I have a central symbol repository defined in the general options --> Rendering --> SVG paths which points to M:\\qgis\\symbole

So the full absolute path for rendering should be: M:/qgis/symbole/stadtplan/toilets.svg

I think Marco H. knows a lot about these path issues with SVG files. So maybe, if there are troubles consult with him. These path isssues come up every now and then. So maybe this should be properly documented in the source so developers can understand the mechanisms.

#3 Updated by Giuseppe Sucameli almost 7 years ago

  • Status changed from Open to Closed

#4 Updated by Giuseppe Sucameli almost 7 years ago

  • Resolution set to fixed

Jürgen Fischer wrote:

where does the absolute path in <prop k="name" v="/stadtplan/toilets.svg"/> come from?

SVG path are stored like absolute paths (with the */* in front) even though they are relative to the SVG folders...
It could be easily changed but I don't know if there was a reason to do it.

Also available in: Atom PDF