https://issues.qgis.org/https://issues.qgis.org/favicon.ico2016-10-17T02:05:28ZQGIS Issue TrackingQGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=730982016-10-17T02:05:28ZMatthias Kuhn
<ul></ul><p>Can you attach a .qgs project file with an affected layer?</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=731002016-10-17T02:13:54ZEDOUARD GOUYON
<ul></ul><p>Matthias Kuhn wrote:</p>
<blockquote>
<p>Can you attach a .qgs project file with an affected layer?</p>
</blockquote>
<p>Sorry I can't. Since The post of this bug, I've definitely downgraded to 2.14 version and the bug doesn't exists anymore. I didn't save any project with 2.16 in order not affect the good styling of my layers with the reported bug.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=731182016-10-18T04:40:31ZSandro Santillistrk@kbt.io
<ul></ul><p>Edouard if I read your original submission correctly we dont' need a project saved by 2.16 but by 2.12 ?</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=731392016-10-19T03:14:08ZMatthias Kuhn
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>I assume that <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/1f1898df1616ce5d3239bf2257470dd2c6b96566" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">1f1898df1616ce5d3239bf2257470dd2c6b96566</a> fixes this issue.</p>
<p>Basically, in 2.12, the scale "0" could be used for an infinitely max scale. In 2.16 1:1 was the max possible, anything else (like 0) would be set equal to the min scale (which could be 1:100'000), resulting in the layer never being visible.</p>
<p>Above commit fixes this for 2.18.</p>
<p>If someone is able to reproduce this with a recent nightly/2.18, please reopen.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=748152017-03-04T17:13:24ZJean-Gabriel JGH
<ul><li><strong>Target version</strong> deleted (<del><i>Version 2.16</i></del>)</li><li><strong>File</strong> <a href="/attachments/download/10789/dummylayer.zip">dummylayer.zip</a> added</li><li><strong>File</strong> <a href="/attachments/download/10790/minScaleReset.qgs">minScaleReset.qgs</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Hello,</p>
<p>I am having the same issue with 2.18.3 and 2.18.4 (Windows 10, 64 bits), with both Shapefiles and Postgres layers.<br />I nailed it down a bit more than the OP. The issue with the "Maximum (inclusive)" occurs only for scales smaller than 1:100,000 (that is, 1:99,999 is fine but 1:100,001 will reset to 1:100,000). When one edits the scale, it is properly saved to the QGS file, under <maplayer minimumScale="100001" [...]>. However if you re-open the layer property, it is displayed as 1:100000 and this value (100000) will then be saved to the QGS file as if you purposely modified the scale.<br />Let's note that the same behavior occurs with rule based styling. Double clicking on a rule resets the Max Scale to 100,000.</p>
<p>As Matthias Kuhn has asked, please find a simple QGS file exhibiting the issue. It refers to a dummy layer (i.e. empty shapefile). This layer (dummylayer_ok) is set to have a max scale of 1:12,345 which works fine. A copy of the layer (dummylayer_reset), with a scale of 1:123,456 is there. You can see the scale in the QGS file but opening its property should show 1:100,000.</p>
<p>PS: I put an emphasis that the issue is, in the GUI, with the MAX scale, but the QGS file records this value as the MIN scale...</p>
<p>Let me know should you need any other information!<br />Jean-Gabriel</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=748512017-03-06T03:33:11ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Category</strong> set to <i>Vectors</i></li><li><strong>Target version</strong> set to <i>Version 2.18</i></li><li><strong>Affected QGIS version</strong> changed from <i>2.16.1</i> to <i>2.18.4</i></li></ul><p>Confirmed here too.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=757142017-04-30T15:06:19ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Regression?</strong> set to <i>Yes</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=757942017-04-30T15:08:54ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Priority</strong> changed from <i>Severe/Regression</i> to <i>High</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=787702017-04-30T23:10:55ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Easy fix?</strong> set to <i>No</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=797702017-05-16T16:40:58ZSandro Santillistrk@kbt.io
<ul><li><strong>Description</strong> updated (<a href="/journals/diff/79770?detail_id=68519" title="View differences">diff</a>)</li><li><strong>Assignee</strong> set to <i>Sandro Santilli</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=797732017-05-16T16:58:51ZSandro Santillistrk@kbt.io
<ul></ul><p>I confirm the issue.</p>
<p>Opening the project you attached (minScaleReset) with QGIS 2.14.10 and opening layer properties gives me:<br /> - dummylayer_reset: min 1:100,000,000 max 1:123,456<br /> - dummylayer_ok: min 1:100,000,000 max 1:12,345</p>
<p>Opening it with QGIS master (2.0.0-dev <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/4ed096b94dff3101786e67a49567544f77c759d8" title="Add test for unprojectible polygon labeling See #15507">4ed096b</a>) gives:<br /> - dummylayer_reset: min 1:100,000,000 max 1:100,000<br /> - dummylayer_ok: min 1:100,000,000 max 1:12,345</p>
<p>I can still set (via GUI) that "max" value to 1:1,000,000, so there's no reason why 1:123,456 should not be accepted.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=797742017-05-16T17:01:15ZSandro Santillistrk@kbt.io
<ul></ul><p>Matthias 7 months ago you referenced <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/1f1898df1616ce5d3239bf2257470dd2c6b96566" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">1f1898df1616ce5d3239bf2257470dd2c6b96566</a> but there's no such commit in the repository, can you remember which commit you were referring to ?</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=797752017-05-16T17:02:15ZSandro Santillistrk@kbt.io
<ul></ul><p>Maybe it was <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/2475ee578c17ef3368d9b4d487599c31340a9a09" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">2475ee578c17ef3368d9b4d487599c31340a9a09</a> ?</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=797772017-05-16T17:15:29ZSandro Santillistrk@kbt.io
<ul></ul><p>I confirm 2.18 branch as of <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/126cf5f100abb077fd0ba611cb1653583dd898cd" title="Check return from QgsPalLabeling::prepareGeometry before dereference Fixes #15507 Includes auto...">126cf5f100abb077fd0ba611cb1653583dd898cd</a> also behaves the same as I reported above as happening in master (qgis-3).</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799692017-05-23T07:50:11ZSandro Santillistrk@kbt.io
<ul></ul><p>I take it back, the commit exists, just isn't recognized by this RedMine instance, looks like:<br /><a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/1f1898df1616ce5d3239bf2257470dd2c6b96566" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">1f1898df1616ce5d3239bf2257470dd2c6b96566</a></p>
<p>Same happens with the later:<br /><a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/2475ee578c17ef3368d9b4d487599c31340a9a09" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">2475ee578c17ef3368d9b4d487599c31340a9a09</a><br /><a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/2475ee578c17ef3368d9b4d487599c31340a9a09" title="Allow 0 (infinite) for scale dependent visibility Fix #15414">qgis|2475ee578c17ef3368d9b4d487599c31340a9a09</a></p>
<p>@jef maybe you know what's going on here with commit references ?</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799742017-05-23T08:43:07ZJürgen Fischerjef@norbit.de
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority- closed" href="/issues/16601">Bug report #16601</a>: commit references do not expand</i> added</li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799822017-05-23T09:15:53ZSandro Santillistrk@kbt.io
<ul></ul><p>2.16 is also affected (at least as of final-2_16_3-106-g7ff0883)<br />Is it possible to turn the "Affected versions" into a multi-choice input ?<br />Or I think it makes sense to set it to the oldest affected branch, to make bisecting easier...</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799872017-05-23T10:53:10ZSandro Santillistrk@kbt.io
<ul></ul><p>I've run a git-bisect, finding that <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/bd3fd748f1e170c8aeb20fbc4f40966f70d33c5b" title="Merge pull request #2863 from pvalsecc/minMaxScale Add check to make sure minScale<=maxScale.">bd3fd748f1e170c8aeb20fbc4f40966f70d33c5b</a> is the first bad one. I still have to dig further (it's a merge commit for <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/4f18701d319afaf03cfd5c49ceb0395a2677da80" title="Add check to make sure minScale<=maxScale. Those two fields are present in the vector layer prop...">4f18701d319afaf03cfd5c49ceb0395a2677da80</a>)</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799972017-05-23T13:12:46ZSandro Santillistrk@kbt.io
<ul><li><strong>Affected QGIS version</strong> changed from <i>2.18.4</i> to <i>2.16.3</i></li><li><strong>Operating System</strong> changed from <i>Windows</i> to <i>Windows, Linux</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=799982017-05-23T13:15:53ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Affected QGIS version</strong> changed from <i>2.16.3</i> to <i>2.18.4</i></li></ul><p>no one will wver worok on 2.16, on the other hand 2.18 is the next release, knowing that LTR is THE affected version is MUCH more important.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800002017-05-23T13:47:37ZSandro Santillistrk@kbt.io
<ul><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul><p>I filed a pull request for 2.18 branch: <a class="external" href="https://github.com/qgis/QGIS/pull/4612">https://github.com/qgis/QGIS/pull/4612</a><br />It's a oneliner, removing a line which looked suspicious in <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/4f18701d319afaf03cfd5c49ceb0395a2677da80" title="Add check to make sure minScale<=maxScale. Those two fields are present in the vector layer prop...">4f18701d319afaf03cfd5c49ceb0395a2677da80</a><br />but I don't really understand why it fixes the issue yet, so it's important to test analyze further</p>
<p>I'll not start an "Affected QGIS version" semantic war here, please use the mailing list for that.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800022017-05-23T14:20:42ZSandro Santillistrk@kbt.io
<ul></ul><p>The PR which introduced the regression, once merged: <a class="external" href="https://github.com/qgis/QGIS/pull/2863">https://github.com/qgis/QGIS/pull/2863</a></p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800032017-05-23T16:44:53ZSandro Santillistrk@kbt.io
<ul></ul><p>Ok so full analysis is as follows:<br /> - When constructing a ScaleRangeWidget:<br /> - A signal handler is installed for scaleChanged signals emitted by minScaleWidget that places a limit on the maxScaleWidget<br /> - The max scale widget is given an arbitrary value of 1:100000, triggering the handler and thus setting a limit on maxScale<br /> - When opening layer properties panel, QgsScaleRangeWidget::setScaleRange is invoked, which tries to set maxScale <strong>before</strong> minScale, thus being limited by the previously set minScale.</p>
<p>So the proper fix here is to change setScalRange to set <strong>min</strong> before <strong>max</strong>.</p>
<p>It is arguable whether the arbitrary values to the range are worth keeping, but if we want to keep them it could be a better idea to use DBL_MIN/DBL_MAX for the limit...</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800042017-05-23T16:48:44ZSandro Santillistrk@kbt.io
<ul></ul><p>New PR replacing the old one: <a class="external" href="https://github.com/qgis/QGIS/pull/4613">https://github.com/qgis/QGIS/pull/4613</a></p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800852017-05-26T08:18:32ZSandro Santillistrk@kbt.io
<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/55ffbf5e932ede65144474c4854000708757b700" title="When setting scale range, make sure to set min before max scale This ensures the limit on max sc...">qgis|55ffbf5e932ede65144474c4854000708757b700</a>.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800862017-05-26T08:22:41ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Reopening to make sure it's also fixed in master branch (3.0.0-dev) - and I'm still working on the testcase. Will send a new PR for master.</p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800902017-05-26T09:08:09ZSandro Santillistrk@kbt.io
<ul></ul><p>PR with testcase for master: <a class="external" href="https://github.com/qgis/QGIS/pull/4633">https://github.com/qgis/QGIS/pull/4633</a></p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800912017-05-26T09:23:05ZSandro Santillistrk@kbt.io
<ul></ul><p>PR with testcase for 2.18 branch : <a class="external" href="https://github.com/qgis/QGIS/pull/4634">https://github.com/qgis/QGIS/pull/4634</a></p> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=800942017-05-26T10:07:41ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Feedback</i></li></ul> QGIS Application - Bug report #15463: Layer "Scale dependent visibility" doesn't work anymore since 2.16https://issues.qgis.org/issues/15463?journal_id=801052017-05-26T11:24:04ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/c0531bcd896741eca4cfd8c83138b5b0181e94df" title="Add test for QgsScaleRangeWidget::setScaleRange Closes #15463 as this test guards after the fix ...">qgis|c0531bcd896741eca4cfd8c83138b5b0181e94df</a>.</p>