-
Notifications
You must be signed in to change notification settings - Fork 990
Open
Description
What is the expected precision of utilities like @turf/lineSlice. I certainly expect some floating point issues, but I noticed one relatively glaring
{
"startPt": {
"type": "Point",
"coordinates": [
1,
2
]
},
"endPt": {
"type": "Point",
"coordinates": [
4,
2
]
},
"line": {
"type": "LineString",
"coordinates": [
[
-1,
2
],
[
5,
2
]
]
},
"result": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
0.9999985123144755,
2.0024376784603275
],
[
4.000001859181029,
2.0015234321498467
]
]
}
}
}
The distance between [1,2] and [0.9999985123144755, 2.0024376784603275] is 0.17 miles, which is significant and much larger than I would have expected for a floating point precision drift in a single calculation.
This may be expected behavior, but if it is, I'd request that the library includes some documentation of the expected tolerances.
Metadata
Metadata
Assignees
Labels
No labels