Bug report #8357
QGIS Server seems to interpret paths to SVG files relative to it's own location
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17137|
There is a difference in behaviour between QGIS Desktop 1.9 and QGIS Server 1.9. QGIS Server seems to interpret paths to SVG files relative to it's own location, QGIS Desktop interprets them relative to the location of the .qgs file.
When styling a vector layer to show svg symbols and then storing them relative to the .qgs file, they are shown in QGIS Desktop 1.9 (The file path was explicitly modified to be relative, not absolute).
When copying the file and the images over to a linux server with QGIS Server running, the symbols only show up when they are not put in a path relative to the .qgs-file, but when they are put in the corresponding path relative to the cgi-bin directory.
#2 Updated by Alessandro Pasotti over 6 years ago
- Priority changed from Normal to High
This is known behaviour (still a bug IMHO) because QGIS stores SVG paths in an odd way (absolute with leading slash), the server then adds the standard SVG path in front of them, the client can also search in user defined paths (as set in Settings->Options).
The option to define user custom paths is global and not saved into the project file, hence the mapserver cannot find it.
Proposed solution is to store this piece of information into the project file so that qgis mapserver can locate the symbols exactly as the QGIS client does.