-
Notifications
You must be signed in to change notification settings - Fork 120
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
Primitive implementation of line intersect #1348
Conversation
e84d36e
to
d7fc569
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one small change request
The handling of line segment endpoint is different from Turf-Swift.
Looks like TurfJS is inclusive as well so we might want to fix this up on the Java side.
Would you be able to cut a separate ticket/PR?
@@ -26,6 +26,43 @@ private TurfMisc() { | |||
throw new AssertionError("No Instances."); | |||
} | |||
|
|||
/** | |||
* Takes lines {@link LineString} and returns intersect points. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be good to mention time complexity and that it's not as efficient as the JS counterpart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I updated the comment
d7fc569
to
6379bb0
Compare
I opened a PR which fixes |
6379bb0
to
8b07285
Compare
By following this comment, I've picked up the fix of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
8b07285
to
d49e824
Compare
Summary
Implement line intersect which is equivalent to turf.lineIntersect with a primitive manner.
Discussion
if
conditions causes the difference. If they are likevarA >= 0 && varA <= 1
, the behavior becomes same. Which Swift/Java is the expected? (This is because the test is slightly different from Turf-Swift)