https://issues.qgis.org/https://issues.qgis.org/favicon.ico2016-10-04T20:32:04ZQGIS Issue TrackingQGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=727902016-10-04T20:32:04ZTudor Bărăscutudorbarascu@yahoo.com
<ul></ul><p>See <a class="external" href="http://docs.qgis.org/2.14/en/docs/user_manual/introduction/qgis_configuration.html#project-properties">http://docs.qgis.org/2.14/en/docs/user_manual/introduction/qgis_configuration.html#project-properties</a></p>
<p>You can choose between relative and absolute paths.</p>
<p>As you observed, QGIS considers the relative paths to the <strong>qgs</strong> project.<br />IMHO qlr is a definition of a layer to be used in the project. So, the datasource should be relative to the project and NOT to the qlr (which just defines the path to the datasource from the project perspective).</p>
<p>Are you saying that you're loading in a project a qlr file and it works but after saving the project (without loading the qlr file afterwards) it doesn't work anymore?</p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=727942016-10-04T23:02:21ZDominique Lyszczarzdomlysz@gmail.com
<ul></ul><p>Actually when saving a QLR the datasource path is relative to QLR destination folder, not the QGS one.</p>
<p>It seems this behaviour was fixed in <a class="issue tracker-1 status-5 priority-4 priority- closed" href="https://issues.qgis.org/issues/10858" title="Datasource file name in .qlr file should be relative to .qlr file (Closed)">#10858</a></p>
<p>But on another hand when QGIS load a QLR it search the datasource with a path relative to the folder where the qgs is saved.</p>
<p>This inconsistency causes lot of troubles.</p>
<p>For example if I have a shapefile in the folder foo/data and a qgs project in the folder foo/qgs, load the shp and save a new QLR to foo/myqlr.qlr then just trying to reopen this QLR and it does not find the datasource (there is no error message but the layer entry in the TOC is empty)</p>
<p>The path in the QLR is ./data/shapefile.shp which is correct (== foo/data/shapefile.shp) but I suspect QGIS search the source at foo/qgs/data/shapefile.shp. If I just resave my project to /foo/myproject.qgs or if I change the path in the QLR to ../data/shapefile.shp, then I can load correctly my QLR file.</p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=735102016-11-30T23:04:53ZJuan Manuel Perez
<ul></ul><p>I agree with Dominique. We hava also stumbled into some problems caused by that inconsistency he points out:<br />"When saving a QLR the datasource path is relative to QLR destination folder, not the QGS one. But, on another hand, when QGIS load a QLR it searchs the datasource with a path relative to the folder where the QGS is saved" <br />If this behaviour is to remain as it is now, then maybe it could be fair if we could have a warning telling the user that loading the generated QLR will fail unless moved next to the QGS file.</p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=776872017-04-30T23:03:04ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Easy fix?</strong> set to <i>No</i></li><li><strong>Regression?</strong> set to <i>No</i></li></ul> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=822542017-09-21T08:51:56ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Category</strong> set to <i>Project Loading/Saving</i></li><li><strong>Description</strong> updated (<a href="/journals/diff/82254?detail_id=70990" title="View differences">diff</a>)</li></ul> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=822582017-09-21T08:56:54ZDominique Lyszczarzdomlysz@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Tested on latest master, now it works correctly. Seems it was fixed a few months ago in <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/5f5c1ddb15c214a8a920ca6b34fab85dfab4f0a6" title="Use a path resolver class instead of QgsProject::instance() in map layers A new class QgsPathRes...">5f5c1ddb15c214a8a920ca6b34fab85dfab4f0a6</a></p>
<p>Thanks !</p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=841452017-11-06T20:06:43ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li><li><strong>Assignee</strong> set to <i>René-Luc ReLuc</i></li><li><strong>Affected QGIS version</strong> changed from <i>2.16.2</i> to <i>2.18.14</i></li></ul><p>This issue has been fixed in master but not in LTR.</p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=841552017-11-07T08:54:50ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul><p>A Pull Request is opened <a class="external" href="https://github.com/qgis/QGIS/pull/5553">https://github.com/qgis/QGIS/pull/5553</a></p> QGIS Application - Bug report #15656: Loading QLR file with relative path does not work correctlyhttps://issues.qgis.org/issues/15656?journal_id=841822017-11-08T09:05:04ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/533a8f8a4d018744541b35b388b060cb8a9e5499" title="[PATCH] [BUGFIX] Load layer from definition does not use qlr as relative path Fixes #15656 Loadi...">qgis|533a8f8a4d018744541b35b388b060cb8a9e5499</a>.</p>