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

Try to fix the contour label visibility problem as described in issue… #1324

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

Framstag
Copy link
Owner

#1220

  • Improved spacing values and fix projection calculation.

…1220

* Improved spacing values and fix projection calculation.
@Framstag Framstag added the bugfix For pull requests that contain a bugfix label Sep 27, 2022
@Framstag Framstag temporarily deployed to SONAR September 27, 2022 20:19 Inactive
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Karry
Copy link
Collaborator

Karry commented Sep 27, 2022

Nice. It is better. But still, some street names visible previously are hidden. Seems that short streets, like https://www.openstreetmap.org/way/22561047#map=19/43.62046/6.97074 are problematic.

@Framstag
Copy link
Owner Author

@Karry The problem is, that the current (new) implementation only evaluates labelSpaces which is now a correct but still rather high value. This result in the requirement, that the way has to be rather long to get a label shown. It should take labelOffset also into account, which should then be a smaller value.
I'm also not yet satisfied with the overall result, I would like the label count to be a sequence of 1,3,7...labels to have a smoother effect on zooming in and out (the overall number of labels would be 1+2+4+8+16....). However that is currently not yet the implementation.

I'll merge this one in the evening and will take a look for an overall improvement in a later separate pull request.

@Karry
Copy link
Collaborator

Karry commented Sep 28, 2022

For shorter way, I would rather ignore spacing (break the rules), instead of not showing label at all.

@Karry
Copy link
Collaborator

Karry commented Sep 28, 2022

I tried to use this modification:

countLabels=std::max(size_t(1), size_t(pow(2.0,floor(log2(double(countLabels))))));

on line 792, as exception for short ways, but the "Rue Pasteur" label was filtered out because of variance test (line 801). It will be hard to find some heuristics for label placement to fill requirements:

  • show at least some label even for shorter ways
  • make it stable to avoid label movements during zooming

@Framstag Framstag merged commit bdf0d90 into master Sep 28, 2022
@Framstag Framstag deleted the Fix_contour_label_visibility branch September 28, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix For pull requests that contain a bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants