-
Notifications
You must be signed in to change notification settings - Fork 0
Osm processing fixes #2
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
base: master
Are you sure you want to change the base?
Conversation
0ec3b60 to
03ebf79
Compare
| else if(waySection.roadClass.getValue() > roadClass.getValue()){ | ||
| roadClass = waySection.roadClass; |
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.
So, higher road class number is the "lowest grade" of road, and here we are ensuring that if a segment contains multiple road classes, we use the "lowest grade"?
| int baseSegment1RoadClass = baseSegment1.getRoadClass().getValue(); | ||
| int baseSegment2RoadClass = baseSegment2.getRoadClass().getValue(); | ||
| int roadClassMergeThreshold = Way.ROAD_CLASS.ClassPrimary.getValue(); | ||
| if(baseSegment1RoadClass != baseSegment2RoadClass && (baseSegment1RoadClass <= roadClassMergeThreshold || baseSegment2RoadClass <= roadClassMergeThreshold)) |
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.
What if both are below the threshold? I think in this case they should be mergeable, but I don't think they are with this logic.
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.
I'd suggest:
if(baseSegment1RoadClass != baseSegment2RoadClass) {
if ((baseSegment1RoadClass < roadClassMergeThreshold && baseSegment2RoadClass >= roadClassMergeThreshold) ||
(baseSegment2RoadClass < roadClassMergeThreshold && baseSegment1RoadClass >= roadClassMergeThreshold)) {
return false;
}
}
See individual commits