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
Coalesce duplicate route concurrencies #1361
Coalesce duplicate route concurrencies #1361
Conversation
Results evaluating commit c8e51d3 (merged with base efa6b27 as 9a24837). See run details. PostgreSQL DB size in MB: 4863 ⇒ 4863 (0.0% change)
expand for details...
|
0c75e49
to
bddfd90
Compare
The route relation concurrency information seems to be specific for the OSM Americana style. Wouldn't is be better to have this information as a private layer of an Americana fork of this repository? |
Route concurrencies are a global feature for any renderer that wishes to display pictoral route shields. Concurrent pictoral route symbols are shown in paper maps all over the world. The fact that OSM Americana was the first style to figure out how to do it technically doesn't take away from it being a general-purpose feature. |
Looks great! Thank you for investigating! |
This reverts commit bc9bbd2.
Problem description
#1128 introduced route relation concurrency information in OpenMapTiles via the
route_X
attributes. The original implementation assumed that there would be a single route relation for eachnetwork
andref
pair. However, it is increasingly common practice to tag a separate route relation for each direction of a route in order to provide awareness to routers and other data consumers of the directionality of a route. This standard and growing practice is described on the OSM wiki page on route directions. Thus, the naïve implementation of #1128 caused duplicate entries to be added asroute_X
attributes in the case where separate route relations were used for directional routes.The following super-relation is an example of a route modeled with multiple route relations based on direction:
https://www.openstreetmap.org/relation/162114
Below is the resultant rendering in openstreetmap-americana, showing an incorrect shield duplication of Ohio, USA state route 104:
Solution description
This PR adds grouping when computing route concurrency information, such that duplicate entries are coalesced in a predictable way. Since this grouping is done only within a route membership join of a single member way, the computational complexity should be trivial.
Below is a re-rendering of the same region on openstreetmap-americana after implementing this change: