You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public int OrientationIndex(LineSegment seg) { int orient0 = (int)Orientation.Index(_p0, _p1, seg._p0); int orient1 = (int)Orientation.Index(_p0, _p1, seg._p1); // this handles the case where the points are Curve or collinear if (orient0 >= 0 && orient1 >= 0) return Math.Max(orient0, orient1); // this handles the case where the points are R or collinear if (orient0 <= 0 && orient1 <= 0) return Math.Max(orient0, orient1); //Bug // points lie on opposite sides ==> indeterminate orientation return 0; }
The code is as follows:
public int OrientationIndex(LineSegment seg) { int orient0 = (int)Orientation.Index(_p0, _p1, seg._p0); int orient1 = (int)Orientation.Index(_p0, _p1, seg._p1); // this handles the case where the points are Curve or collinear if (orient0 >= 0 && orient1 >= 0) return Math.Max(orient0, orient1); // this handles the case where the points are R or collinear if (orient0 <= 0 && orient1 <= 0) return Math.Max(orient0, orient1); //Bug // points lie on opposite sides ==> indeterminate orientation return 0; }
This bug line should be fixed to:
if (orient0 <= 0 && orient1 <= 0) return Math.Min(orient0, orient1);
JTS fixed a similar bug: locationtech/jts#914
libgeos/geos#699
The text was updated successfully, but these errors were encountered: