It has a bug When creating a buffer with offset where the last point is collinear with previous points.
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
the coordinate is [[115.7199362, 25.7509046], [115.7199329, 25.7508987], [115.7199352, 25.7508985], [115.7199612, 25.7509045], [115.7199477, 25.7509016]].
and the code like this
let line = {
"type": "Feature",
"properties": {
"color": "#00FF00"
},
"geometry": {
"type": "LineString",
"coordinates": [[115.7199362, 25.7509046], [115.7199329, 25.7508987], [115.7199352, 25.7508985], [115.7199612, 25.7509045], [115.7199477, 25.7509016]]
}
};
let lineGeoJson= turf.lineOffset(line, 2, {units: 'meters'});
let buffered = turf.buffer(lineGeoJson, 2, { units: "meters" });
the result of buffer is not true.
buffer is too large.
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
Reproduce the provided LineString case through lineOffset and buffer, then inspect those entry points and the buffer handling for a final collinear point. Add a regression test covering the coordinates and verify that the resulting buffer is no longer too large.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100