[Qgis-developer] [QGIS-Server] Relative paths and QGIS-Server

René-Luc Dhont rldhont at gmail.com
Mon Sep 21 06:07:32 PDT 2015


Hi Devs,
Hi Marco,

I encounter some troubles with relative paths and QGIS-Server. For 
example, SVGMarker path and NETCDF datasource are not resolved in QGIS 
Server unlike in QGIS Desktop.

To resolve relative path for SVGMarker, the class QgsSombolLayerV2Utils 
is used and it based on QgsProject::instance()->fileName().
To resolve relative path for NETCDF datasource and other GDAL 
datasources, the class QgsMapLayer is used and it based on 
QgsProject::instance()->readPath( filename ).

QGIS Server uses the QgsServerProjectParser to convert relative path to 
absolute path. This mean that it parses the project and update paths.

To fixe this issue, we have 2 solutions :
* Set the QgsProject instance FileName in the QgsServerProjectParser
* Update QgsServerProjectParser::createLayerFromElement to resolve and 
update SVGMarker path and GDAL datasources

Marco, I'dlike to have your point of view to fix it.

Regards,


More information about the Qgis-developer mailing list