Bug report #16550
Virtual layer path is not relative
|Affected QGIS version:||2.18.7||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24456|
I've set the configuration in my project to use relative path.
If I rename the directory I use in my project, then reopen it, QGIS asks me for providing path as it's not relative in fact.
I would expect for portability to use virtual layer with relative path whereas it's absolute in fact.
It seems this behaviour is what was initially planned (https://gis.stackexchange.com/questions/200620/qgis-virtual-layer-path-never-saved-as-relative) but from a end user, it's annoying.
#2 Updated by Thomas Gratier about 3 years ago
It's the path to the datasource that is not relative. You can see the demo project at https://gist.github.com/ThomasG77/6d3373b9024a6179fc3a6b092dd6d03d to reproduce the behaviour.
I've put some instructions to hopefully help you sort out the "issue".
I'm not sure what you mean when you mentioned VRT. I know it's a file in the GDAL context to abstract datasource but I do not fully understand the relationship in the QGIS context as I do not see any created VRT file when using "QGIS Virtual Layer" (or maybe it's under the hood).