-
Notifications
You must be signed in to change notification settings - Fork 398
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
fix: way surface type storage #1794
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
Use enumerations instead of simple integer constants in order to be able to store the surface types internally under different IDs than the corresponding API values.
Check whether values corresponding to the surface types can be reliably written and retrieved from the storage. The test currently fails because the number of different surface types exceeds the available data type range of 4 bits.
Remove some less common and relevant surface types such as "woodchips", or ambiguous ones: "fine gravel" and "cobblestone" in order to be able to encode them as 4-bit values. Note that "woodchips" has never been functional because its original value of 16 exceeds the available data type range of 4 bits.
Improves code readability and potentially performance.
Address issue reported by sonarcloud by replacing calls to `com.graphhopper.storage.Directory#find(java.lang.String)` by `com.graphhopper.storage.Directory#create(java.lang.String)`
According to OSM wiki `surface=earth` is a synonym of `surface=dirt` and is used for where surface is exposed earth/soil/dirt but it is not sand or gravel or rock.
Ways labelled with OSM tag `surface` set to "unhewn_cobblestone", "bricks" or "brick" are classified as surface type "Paving Stones" rather than "Unknown".
Ways labelled with OSM tag `surface` set to "rock", "rocks", "stone", "shells" or "salt" are classified as surface type "Unpaved" rather than "Unknown".
Ways labelled with OSM tag `surface` set to "chipseal", "bitmac" or "tarmac" are classified as surface type "Asphalt" rather than "Unknown". According to OSM wiki most of chipseal and bitmac surfaces are likely tagged as `surface=asphalt`, whereas `surface=tarmac` is often incorrectly used for asphalt/concrete surfaces as actual tarmacadam is very unusual.
Ways labelled with OSM tag `surface` set to "soil" are classified as surface type "Dirt" rather than "Unknown".
…crete" According to OSM wiki `surface=cement` is often used, by mistake, instead of `surface=concrete`.
Road classification doesn't necessarily imply surface. For example, driveways which are supposed to be tagged as `highway=service` + `service=driveway` are in many cases not paved.
Quality Gate passedIssues Measures |
sfendrich
approved these changes
May 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the fix and all the cleanup!
aoles
added a commit
that referenced
this pull request
May 24, 2024
TheGreatRefrigerator
pushed a commit
that referenced
this pull request
May 24, 2024
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.
Pull Request Checklist
have been resolved.
[Unreleased] heading.
along with a short description of what it is for, and documented this in the Pull Request (below).
(at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
importer etc.), I have generated longer distance routes for the affected profiles with different options
(avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
points generated from the current live ORS.
If there are differences then the reasoning for these MUST be documented in the pull request.
and why the change was needed.
Fixes #1779.
Information about the changes
In order to be able to encode surface categories as 4 bit values their number has been reduced to 16 by removing the following ones:
surface=cobblestone
is quite generic as it is used for bothsett
andunhewn_cobblestone
. As such it is ambiguous, becausesett
is already classified as "Paving Stones".surface=fine_gravel
is used somewhat inconsistently. It may be used to specify fine loose gravel (...), but it is also sometimes used as an alias for compacted. Therefore, it seems to make sense to marge it with the more generic category forsurface=gravel
which has very large meaning range. Used for cases ranging from huge gravel pieces like track ballast used as surface, through small pieces of gravel to compacted surface.Additionally, the category for
surface=earth
(0.25%) has been changed from "Ground" to "Dirt", and some less common surface types have been assigned to one of the existing categories. All the changes are summarized inthe table below. It lists the top 50 values of way
surface
tags which have a Wiki entry, with "Special" types of surfaces removed. The values from the change column override those from the current one.Fine GravelCobblestoneWoodchips