locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.98k stars 443 forks source link

Incorrect orientation index #893

Closed daniellivesey90 closed 2 years ago

daniellivesey90 commented 2 years ago

The Math.min function should be used on this line to ensure consistent behaviour with the description and left case i.e. an orientation index of -1 (right) when one point lies to the right of the line and the other lies on the line.

https://github.com/locationtech/jts/blob/25510f7efc78648c7c8962b47b942f3ee3804f8c/modules/core/src/main/java/org/locationtech/jts/geom/LineSegment.java#L162

A suggested fix has been submitted on the NTS repo: https://github.com/NetTopologySuite/NetTopologySuite/pull/618