Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale Dependent Visibility on layer wrong on scale interval edges in EPSG:25832 #58150

Closed
2 tasks done
chau-intl opened this issue Jul 17, 2024 · 3 comments · Fixed by #58968
Closed
2 tasks done

Scale Dependent Visibility on layer wrong on scale interval edges in EPSG:25832 #58150

chau-intl opened this issue Jul 17, 2024 · 3 comments · Fixed by #58968
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map Tools Related to non-digitizing map tools

Comments

@chau-intl
Copy link
Contributor

chau-intl commented Jul 17, 2024

What is the bug or the crash?

I have two layers, L1 and L2, and both has Scale Dependent Visibility (Layer Properties / Rendering) enabled:

  • L1 has Maximum (inclusive) set to 1:1 and has Minimum (exclusive) set to 1:100.
  • L2 has Maximum (inclusive) set to 1:100 and has Minimum (exclusive) set to 1:1,000.

When setting the zoom level of QGIS to exactly 1:100 both L1 and L2 are visible. I would expect L1 to be invisible (since it has exclusive on Minimum) and L2 to be visible (since it has inclusive on Maximum).

I didn't submit this ticket just because of issues with scale 1:100. I see the same issue at scale 1:10,000, 1:25,000, 1:100,000, 1:250,000 and 1:1,000,000 but not at scale 1:50,000, 1:500,000 and 1:5,000,000.

Steps to reproduce the issue

Add two layers and set the scale dependent visibility of both layers according to the bug-description.

Versions

3.34.8, 3.38.0, 3.39 (67e0563) - all on Windows 10.

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

Looking briefly at the code I see this:

const double Qgis::SCALE_PRECISION = 0.9999999999;

QGIS/src/core/qgsmaplayer.cpp

Lines 1147 to 1151 in 9e47ca4

QGIS_PROTECT_QOBJECT_THREAD_ACCESS_NON_FATAL
return !mScaleBasedVisibility ||
( ( mMinScale == 0 || mMinScale * Qgis::SCALE_PRECISION < scale )
&& ( mMaxScale == 0 || scale < mMaxScale ) );

Could the SCALE_PRECISION be the reason that both layers are rendered at exactly 1:100 in EPSG:25832?

@chau-intl chau-intl added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 17, 2024
@chau-intl chau-intl changed the title Scale Dependent Visibility on layer wrong on scale interval edges Scale Dependent Visibility on layer wrong on scale interval edges in EPSG:25832 Jul 17, 2024
@agiudiceandrea agiudiceandrea added the Map Tools Related to non-digitizing map tools label Jul 21, 2024
@gacarrillor
Copy link
Member

@chau-intl, this should be solved for QGIS 3.40, which will be available on 25th October.
Feel free to reopen if you still find issues.

@chau-intl
Copy link
Contributor Author

@gacarrillor, I have just tested the QGIS nightlies and in my use cases now it works. Thanks a lot for looking into this!

@gacarrillor
Copy link
Member

Great! Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map Tools Related to non-digitizing map tools
Projects
None yet
3 participants