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
BUGFIX: Ignore duplicate route concurrencies #1233
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Results evaluating commit 3c95f05 (merged with base 5b0c289 as 111c1d0). See run details. PostgreSQL DB size in MB: 2792 ⇒ 2792 (0.0% change)
expand for details...
|
Awesome! Thanks a lot! |
TomPohys
approved these changes
Sep 17, 2021
TomPohys
pushed a commit
that referenced
this pull request
Sep 21, 2021
…1239) This PR is a bugfix for the `transportation_name` layer. Currently, the updates process does not work, as noted by @zstadler in #1230. The issue is that the computed `concurrency_index` column in `osm_route_member` is never updated after the initial updates. Therefore, whenever route member ways are updated, they will lose their route concurrency index, and hence route concurrencies will be lost in the `transportation_name` tiles. This PR adds the missing concurrency index update code to the transportation/network update triggers. This PR as written also incorporates the fixes in #1230 and #1233. The following SQL is a unit test to demonstrate that these triggers work correctly: ``` select count(*) from osm_route_member where concurrency_index > 5; select count(*) from osm_transportation_name_network where route_6 is not null; update osm_route_member set concurrency_index=NULL where concurrency_index > 5; select count(*) from osm_route_member where concurrency_index > 5; select count(*) from osm_transportation_name_network where route_6 is not null; ``` If working correctly, both pairs of `count(*)` values should return the same pair of numbers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While troubleshooting #1230, I discovered that there were cases where a way was a member of the same route relation more than once, such as: https://www.openstreetmap.org/way/17439235
This segment would end up showing duplicate highway shields in a rendered style, which is not desirable. While I personally think this style of tagging is wrong, it's a relatively easy fix to remove those duplicates. This PR replaces
ROW_NUMBER()
withDENSE_RANK()
in the concurrency index generation code and adds aDISTINCT
constraint on the concurrency join to handle multiple member rows with the same concurrency index.Since I was in this file, I also fixed the copy/paste error in generating the route names.
Screenshot from database showing correct mapping: