-
Notifications
You must be signed in to change notification settings - Fork 943
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
base: master
Are you sure you want to change the base?
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?
@@ -18,16 +18,13 @@ import { sweeplineIntersections as findIntersections } from "./lib/sweepline-int | |||
* @param {GeoJSON} line1 any LineString or Polygon | |||
* @param {GeoJSON} line2 any LineString or Polygon | |||
* @param {Object} [options={}] Optional parameters | |||
* @param {boolean} [options.removeDuplicates=true] remove duplicate intersections | |||
* @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features | |||
* @param {boolean} [options.removeDuplicates=true] remove duplicate intersections (default `true`) |
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.
No need to add (default true
) - JSDoc appends that automatically. See generated README.md where it gets repeated.
@@ -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.
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.