lineSplit does not split horizontal lines that have more than 7 decimals in latitude
Open
Nobody has claimed this yet.
@turf/line-split
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Turf Version: 6.3.0
lineSplit does not split horizontal lines whose latitudes have more than 7 decimal places.
For example, the test below fails
test("turf-line-split -- splitting horizontal lines with more than 7 lat decimals", (t) => {
const x1 = 0
const x2 = 10;
const y = 0.12345678;
const xMid = (x1 + x2)/2;
const line = lineString([[x1, y], [x2, y]]);
const splitter = point([xMid, y]);
const { features } = lineSplit(line, splitter);
// these fail; real result is an un-split line: lineString([ [ x1, y ], [ x2, y] ])
t.isEqual(features.length, 2)
t.deepEquals(features[0], lineString([[x1, y], [xMid, y]]));
t.deepEquals(features[1], lineString([[xMid, y], [x2, y]]));
t.end();
})
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the lineSplit entry point and reproduce the supplied horizontal-line case with latitude 0.12345678. Add the regression test shown in the issue, then verify that the line is split into two expected features and that the existing lineSplit tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100