-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add epsilon option to booleanPointOnLine (#2051)
* Add precision option to booleanPointOnLine * Increase precision to 10 * Update parameter to epsilon This also preserves backwards compatibility Co-authored-by: mfedderly <mdfedderly@mdfedderly.com>
- Loading branch information
Showing
5 changed files
with
92 additions
and
4 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
27 changes: 27 additions & 0 deletions
27
...ean-point-on-line/test/false/PointIsOnLineButFailsWithSmallEpsilonValue.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,27 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"properties": { | ||
"epsilon": 10e-18 | ||
}, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-75.25737143565107, 39.99673377198139] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ | ||
[-75.2580499870244, 40.00180204907801], | ||
[-75.25676601413157, 39.992211720827044] | ||
] | ||
} | ||
} | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
...test/false/PointIsOnLineButFailsWithoutEpsilonForBackwardsCompatibility.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,24 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-75.25737143565107, 39.99673377198139] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ | ||
[-75.2580499870244, 40.00180204907801], | ||
[-75.25676601413157, 39.992211720827044] | ||
] | ||
} | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/turf-boolean-point-on-line/test/true/PointOnLineWithEpsilon.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,27 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"properties": { | ||
"epsilon": 10e-17 | ||
}, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-75.25737143565107, 39.99673377198139] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ | ||
[-75.2580499870244, 40.00180204907801], | ||
[-75.25676601413157, 39.992211720827044] | ||
] | ||
} | ||
} | ||
] | ||
} |