Projection problem with buffer function
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
I use @turf/turf 6.5.0.
Features of the screenshot :
{
type: 'Feature',
geometry: { type: 'LineString', coordinates: Array.from({ length: 27 }, (_, i) => [20, i * 5 - 65]) },
properties: {}
},
...Array.from({ length: 27 }, (_, i) => ({ type: 'Feature', geometry: { type: 'Point', coordinates: [0, i * 5 - 65] } as GeometryPoint, properties: {} } as GeoJsonFeature<GeometryPoint>))
When I create a 140 miles buffer with the turf buffer function, here's what happened :

(For rendering the map, I use OpenLayer 7.1.0 in projection EPSG:4326)
The buffer of each point is correct, but every time I try to buffering an other king of Geometry, such as LineString or Polygon, the buffer is not correct : it doesn't respect the projection and the distances.
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 Turf's buffer function and reproduce the reported result with the supplied LineString, Point features, 140-mile distance, and EPSG:4326 context. Compare the LineString and Polygon outputs with the point buffers, then define done as distances and geometry respecting the intended projection, with regression coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100