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

QRank for dynamic styling #8472

Open
euf opened this issue Jun 16, 2024 · 2 comments
Open

QRank for dynamic styling #8472

euf opened this issue Jun 16, 2024 · 2 comments
Labels
Drape Drape OpenGL, Vulkan and Metal graphics rendering engine Enhancement New feature or request, an improvement of some existing feature Generator Related to generator tool. Map Data OpenStreetMap data related issues Styles Map drawing styles World Map Issues about improving the base map of the whole world that is bundled with the app

Comments

@euf
Copy link
Contributor

euf commented Jun 16, 2024

This is a raw idea, which is quite ambitious per se, and a discussion of its technical feasibility is needed.

Is your feature request related to a problem? Please describe.

There were several previous discussions of "dynamic styling", which as a theoretical solution to the limitations of existing hardcoded drawing rules. See #6016, #6331, #6332, #8464, and many others.

The idea of utilizing QRank for better importance ranking was raised in #7967.

Describe the ideal solution

The "ideal solution" would essentially be the one which always shows the most relevant map features in favor of less interesting ones. In other words, any viewport at any zoom should include as much data as it can fit, all ranked by prominence. Since it's not realistic with the current implementation, I suggest we try to move towards it with some heuristics.

Could it be technically possible to

  1. At the generator stage, add a QRank value to all map objects, which have wikidata / brand:wikidata / operator:wikidata in their tags?
  2. At the map rendering, always prioritize features with QRank over those which don't have it?

This way a first step could be made towards "dynamic styling". I imagine an algorithm which

  • Draws a base layer (land, water, roads) depending on existing drawing rules.
  • Runs a first pass of POI candidates displacement for QRanked map features, using current drawing rules for them but with increased zoom (for example, if museums are usually [z10-], those with rank are allowed at [z9-]). Obviously we don't show lower ranked features if they overlap with a higher ranked ones.
  • Finally, features without QRank are rendered, but if and only if they don't overlap the ones we prioritized in the previous step.

Describe alternatives you have considered

  • Popular apps, such as Google and Apple Maps, seem to heavily utilize search ranking for POIs display order. It's not possible to replicate their results with limited access to aggregated user data, but my idea seems to be as close as we can realistically get.
  • Since I'm not an expert either in MWM file structure or in drape architecture, my algorithm may be suboptimal from the technical point of view. I hope it's still possible to find an efficient solution with the same motivation.
  • Further tweaks to my naive algorithms are possible, such as calculating a combined weight of population × QRank for human settlements, using a multiplier for features tagged as attraction, etc. At the moment I don't think these complex approaches are really needed, but there's definitely room for even more creative algorithms.
@euf euf added Enhancement New feature or request, an improvement of some existing feature Map Data OpenStreetMap data related issues Drape Drape OpenGL, Vulkan and Metal graphics rendering engine Styles Map drawing styles Generator Related to generator tool. World Map Issues about improving the base map of the whole world that is bundled with the app labels Jun 16, 2024
@biodranik
Copy link
Member

Dynamic styling we discussed is a generic problem, not only related to POIs. What you are discussing here is more about "if we have many POIs to render, how to choose the most relevant ones to a user?".

A generic problem sounds like this: "what should be displayed at this place at this zoom level to make the map usable for the user?" It involves drawing forests/lakes/roads/towns/villages/POIS earlier if the map is empty, or later, if the map is too overloaded.

@euf
Copy link
Contributor Author

euf commented Jun 16, 2024

I understand that the perfect dynamic styling involves drawing forests/lakes/roads/towns/villages/POIS earlier if the map is empty, or later, if the map is too overloaded. If I understand correctly, it's technically hard to prioritize all possible map features in runtime. Hence the traditional drawing rules approach emerges.

What I suggest is a first step from hardcoded drawing rules towards dynamic styling prioritization. If it works, we could then gradually relax drawing rules more and more while also improving ranking algorithms. This way we would arrive to dynamic styling step by step, without the single major overhaul of the app architecture. The discussed QRank is pre-calculated for many features, including roads and water bodies, but it seems easier to start with POIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drape Drape OpenGL, Vulkan and Metal graphics rendering engine Enhancement New feature or request, an improvement of some existing feature Generator Related to generator tool. Map Data OpenStreetMap data related issues Styles Map drawing styles World Map Issues about improving the base map of the whole world that is bundled with the app
Projects
None yet
Development

No branches or pull requests

2 participants