Bug report #8357

QGIS Server seems to interpret paths to SVG files relative to it's own location

Added by Jan David Bendrien over 10 years ago. Updated over 8 years ago.

Status:Closed
Priority:High
Assignee:-
Category:QGIS Server
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

Description

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.

History

#1 Updated by Jan David Bendrien over 10 years ago

the version of qgis is: 1.9.0+git20130704+630427f~precise-ubuntugis1 (installed on a ubuntu machine)

#2 Updated by Alessandro Pasotti over 9 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.

#3 Updated by Tudor Bărăscu over 8 years ago

  • Status changed from Open to Closed

Closing in favor of #13703
Sorry, I somehow couldn't find the opened issue when searching for it, so I opened up a newer one.

Also available in: Atom PDF