-
Notifications
You must be signed in to change notification settings - Fork 946
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
Revert self intersection behavior: line-intersect
#2742
Revert self intersection behavior: line-intersect
#2742
Conversation
…json test case, add self intersection test
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.
Hi @pm0u. Added a couple of comments. The code change itself is fine. Would you mind adding some more tests to better lock down the current ignores behaviour with other feature types?
@@ -132,3 +132,48 @@ test("turf-line-intersect - polygon support #586", (t) => { | |||
t.equal(results.features.length, 1, "should return single point"); | |||
t.end(); | |||
}); | |||
|
|||
test("turf-line-intersect - self intersection behavior", (t) => { |
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.
Are there advantages to running the same features through both "in code" and as in/out fixture tests?
Would you mind adding some simple tests for MultiLineString, Polygon, and MultiPolygon as well e.g.
To be honest I'm not sure what the expected behaviour of those are. Should ignoreSelfIntersections apply to the entire MultiLineString, or only take effect within each individual LineString? If you're got the time let's take this opportunity to embed whatever the behaviour is into some baseline tests.
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.
Probably no reason to have both - is there a preference for one or the other? Its not clear to me why some tests are based on fixtures - is this preferred for simple T/F style testing?
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.
Remembering my logic here - The reason was that the tests below specifically test the behavior of the ignoreSelfIntersections
param. Because the in/out fixture tests all use the same setup it can't be validated in that setting.
If we think this approach makes sense I can add a note as to why this is set up this way.
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.
Fixtures were probaby chosen to avoid 1000s of lines of geojson in code. If that approach doesn't fit nicely though, by all means add normal test cases.
Added a few more test cases, let me know if there are any additional cases we would like covered
All of the above test cases produce no intersecting geometries when |
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.
If you can please restore the // addToMap
line of the example, good to go 👍
Once that's pushed and CI passes again, I'll go ahead and merge.
…tions-line-intersect
…m0u/turf into pm0u/self-intersections-line-intersect
@smallsaucepan I believe this should be in a state to be merged. Please let me know if you find any issues at this point, I believe I addressed everything in your last round of feedback |
Purpose: Bug fix
Partially Addresses:
#2728
#2722
line-intersect
ignoreSelfIntersections
totrue
ignoreSelfIntersections
and explicitly setting to false, using same geometry from the geojson test case added.