-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invert order of calc of segment intersections
When the input has two already exactly-overlapping segments with a third that crosses the two, rounding errors can cause slightly different intersection points to be computed. It appears that calculating the intersections in this order avoids these rounding errors from creating disjoint or extraneous segments (at least for this test case, which is the only one I know about now... there could be other circumstances which still fail, in which case a bigger fix will be necessary). Fixes #19
- Loading branch information
Showing
7 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": null, | ||
"geometry": { | ||
"type": "MultiPolygon", | ||
"coordinates": [ | ||
[[[541, -42], [538.88, -41.92], [540.09, -43.74], [541, -42]]], | ||
[[[538, -44], [540.09, -43.74], [538.88, -41.92], [538, -44]]], | ||
[[[541, -44], [539.87, -43.37], [538.73, -44.88], [541, -44]]] | ||
] | ||
} | ||
} | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
test/end-to-end/parallel-lines-with-crossing/union.geojson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "Feature", | ||
"properties": null, | ||
"geometry": { | ||
"type": "MultiPolygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
[538, -44], | ||
[539.538903654485, -43.808557440111905], | ||
[538.73, -44.88], | ||
[541, -44], | ||
[540.1901555424297, -43.548493797991746], | ||
[541, -42], | ||
[538.88, -41.92], | ||
[538, -44] | ||
] | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters