Turfjs / Turfjs/turf

lineSlice on a loop

Open
#2,872 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

If the given line is a loop (last point identical to the first point), the slice till the end of the line will not work.

Given a linestring
line = ABCDA :
lineSlice(C, A, line) will return the line ABC instead of CDA.

Note that lineSlice(C, A, line) will be identical to lineSlice(A, C, line) in that case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the lineSlice entry point and reproduce the ABCDA loop case described in the issue. Trace how slicing handles a request from C to the repeated A, then verify that the result is CDA rather than ABC and add coverage for this regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.