-
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
lineSliceAlong fails #1710
Comments
@tpolong Looks like a bug. There's an edge case here. If the start point is exactly on the end point of the line, the
The code fix is to either return a LineString with the end point repeated (the spec is unclear if this is a valid line) or disallow this case. I think the first is fine. In the meantime, you can test for this condition by checking the |
@dpmcmlxxvi The turf.linechunk function also uses the line-slice-along function ,but it doesn't test for this condition by checking the turf.length(route) < startDist before calling slice.( in the sliceLineSegments function ) |
@tpolong It doesn't look like the |
@dpmcmlxxvi var route = {
If numberOfSegments is integer, no need to plus 1.In the case numberOfSegments pluses 1,so the code will have errors |
@tpolong This looks like a different bug due numerical precision. Please submit as a different issue. |
Looks like a duplicate of #1577 |
when I use turf.lineSliceAlong(route,8.461539655960873,8.478462735272794,, {units: 'kilometers'})
There will have a mistake,
(Uncaught Error: coordinates must contain number).
Code return lineString(coords[coords.length - 1]) as a point ,but the point could not be a linestring
The text was updated successfully, but these errors were encountered: