Skip to content

Conversation

@mandu
Copy link

@mandu mandu commented Dec 8, 2023

See individual commits

@mandu mandu force-pushed the osm-processing-fixes branch from 0ec3b60 to 03ebf79 Compare December 8, 2023 11:01
Comment on lines +172 to +173
else if(waySection.roadClass.getValue() > roadClass.getValue()){
roadClass = waySection.roadClass;
Copy link

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))
Copy link

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.

Copy link

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;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants