Bug report #10327

QGIS server does not load files from custom folders

Added by Paolo Cavallini about 6 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:Radim Blazek
Category:QGIS Server
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18750

Description

In QGIS desktop it is possible to define custom paths for symbols.
When moving the project to QGIS server, the path is not found.
For complete portability from desktop to server, this should not happen.
Care should be taken for different path styles in different OSs (typically C:\\Something in Windows, /home/somethingelse in *nix).

Associated revisions

Revision d652a809
Added by Radim Blazek about 6 years ago

mapserver QGIS_OPTIONS_PATH support, fixes #10327

History

#1 Updated by Paolo Cavallini about 6 years ago

Please note that the solution to this issue should not rely on apache conf (rewrite and the like), to be more general (e.g. people is using QGIS behind Tomcat, etc.).

#2 Updated by aperi2007 - about 6 years ago

A good compatible solution with tomcat is the solution adopted by MapServer for its mapfile (we speak of svg but the question is the same)
http://www.mapserver.org/environment_variables.html

For the mapfile mapserver allow to define a
environ.variable named

MS_MAPFILE and read it when it start.

I know the SVG paths could be more than one, but there are two kind of solutions:
the first is point the env variable to a file where there is enumerate all the paths.
The second possible solution is to named the env variables with a common prefix and search all the variable having that prefix.

ie:

QGIS_SVG_1 = path1
QGIS_SVG_2 = path2
QGIS_SVG_3 = path3

#3 Updated by Radim Blazek about 6 years ago

  • Status changed from Open to Closed

#4 Updated by Radim Blazek about 6 years ago

Because there are potentially many options which may be useful also in server, I added to server support for QGIS_OPTIONS_PATH environment variable which sets path to a directory where settings are stored. It works in the same way as qgis application --optionspath option. Attention that default settings file name on UNIX is QGIS/QGIS2.conf, while with QGIS_OPTIONS_PATH or --optionspath it is QGIS/QGIS2.ini (.conf x .ini).

To specify SVG path for QGIS server you can copy user settings or create settings file, for example /path/to/config/QGIS/QGIS2.ini:

[svg]
searchPathsForSVG=/path/to/svg1|/path/to/svg2

multiple paths are separated by '|' (pipe). Then set environment variable on server, for example apache conf:
SetEnv QGIS_OPTIONS_PATH "/path/to/config/" 

#5 Updated by Radim Blazek about 6 years ago

  • Assignee set to Radim Blazek

Ticket fixed with funding from Regione Toscana-SITA (CIG:ZB10C90E5A).

#6 Updated by Milos Kroulik about 5 years ago

I tried to follow and set up configuration file, but wasn't successful - instead of symbols, only "?" are displayed. Is there some way to debug this?

Also available in: Atom PDF