Coalesce duplicate route concurrencies (#1361)

# 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 each `network` and `ref` 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](https://wiki.openstreetmap.org/wiki/Route_directions).  Thus, the naïve implementation of #1128 caused duplicate entries to be added as `route_X` attributes in the case where separate route relations were used for directional routes.

# 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.
This commit is contained in:
Brian Sperlongano
2023-01-26 10:15:47 -05:00
committed by GitHub
parent efa6b27fba
commit bc9bbd2e67
3 changed files with 36 additions and 0 deletions

View File

@@ -147,4 +147,22 @@
<tag k="route" v="hiking"/>
<tag k="network" v="nwn"/>
</relation>
<!-- Route Concurrency de-duplication -->
<relation id="515" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" changeset="1" user="u" uid="1">
<member type="way" ref="5000" role=""/>
<tag k="type" v="route"/>
<tag k="route" v="road"/>
<tag k="network" v="US:I"/>
<tag k="ref" v="95"/>
<tag k="description" v="I-95 Northbound"/>
</relation>
<relation id="516" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" changeset="1" user="u" uid="1">
<member type="way" ref="5000" role=""/>
<tag k="type" v="route"/>
<tag k="route" v="road"/>
<tag k="network" v="US:I"/>
<tag k="ref" v="95"/>
<tag k="description" v="I-95 Southbound"/>
</relation>
</osm>