Skip to content
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 LineSegment.orientationIndex(LineSegment) #699

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Oct 11, 2022

Fix LineSegment.orientationIndex(LineSegment) to have correct result for the case of a non-collinear segment on the right side of the target segment.

Port of locationtech/jts#914

@dr-jts dr-jts added the Bug label Oct 11, 2022
@dr-jts dr-jts self-assigned this Oct 11, 2022
@@ -186,7 +186,7 @@ LineSegment::orientationIndex(const LineSegment& seg) const
}
// this handles the case where the points are R or collinear
if(orient0 <= 0 && orient1 <= 0) {
return std::max(orient0, orient1);
return std::min(orient0, orient1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love a two character fix...

@dr-jts dr-jts merged commit 70c0aa3 into libgeos:main Oct 11, 2022
@dr-jts dr-jts deleted the fix-linesg-orientationindex branch October 11, 2022 20:19
@strk
Copy link
Member

strk commented Oct 11, 2022 via email

@pramsey
Copy link
Member

pramsey commented Oct 11, 2022

There's several! But the fix is two-char.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants