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

Improve points co-linearity test in LineIntersector::hasIntersection. #41

Closed
wants to merge 1 commit into from
Closed

Improve points co-linearity test in LineIntersector::hasIntersection. #41

wants to merge 1 commit into from

Conversation

mloskot
Copy link
Contributor

@mloskot mloskot commented Dec 1, 2014

Add simple test based on area of triangle created by three points of the given segment and test point.
The point intersects the segment, if area of the triangle is zero or close to zero: insignificant relatively to length of the segment.

Two interesting observations:

  1. The fix allows to pass the point on segment test discussed in http://trac.osgeo.org/geos/ticket/591 and Port DoubleDouble and CGAlgorithmsDD support #40
  2. All GEOS tests pass, but one fails. Namely, "testA", test<13>): tests/unit/algorithm/RobustLineIntersectorTest.cpp:247 which is opposite to the "point on segment" test:

Segment located as close and parallel as possible to X axis, so it seems on X axis (so 0,0 intersects), but JTS/GEOS are expected to detect it's not on X axis.

I haven't tested this modification with JTS, but I might, so I could ask @dr-jts for comments too.

Add simple test based on area of triangle created by three points
of the given segment and test point.
The point intersects the segment, if area of the triangle is
zero or close to zero: insignificant relatively to length of the segment.

Two interesting observations:
1) The fix allows to pass the "point on segment" test discussed in
http://trac.osgeo.org/geos/ticket/591 and PR: #40
2) All GEOS tests pass apart from (testA, test<13>):
tests/unit/algorithm/RobustLineIntersectorTest.cpp:247
which is opposite to the "point on segment" test:
segment located as close and parallel as possible to X axis,
so it seems on X axis (so 0,0 intersects), but
JTS/GEOS are expected to detect it's not on X axis.
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.

None yet

1 participant