turf.intersect to fit isobands results in incorrect output
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Good morning all,
I am using turf and Mapbox to draw isobands in a circular area by:
Using turf.interpolate to generate the grid of values,
Using turf.isobands to draw isobands on the resulted rectangular grid,
Then using turf.intersect to cut the bands to fit into the circular area {the intersect between the area and each band or between the area and each polygon in the band in case the band.geometry.coordinates.length > 1, taking into account that if the intersection is null this means the band/polygon is fully contained within the area}
The issue is that: this works well but infrequently the result contains outside the area a part from the original isobands which expected to be cut using the intersection to fit the bands totally in the area. This is an illustrative image.
Any help to generate the correct required result would be appreciated
Thank you.

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
Read the turf.interpolate, turf.isobands, and turf.intersect entry points and reproduce the circular clipping workflow described in the report. No input data or test file is supplied, so first reduce the case to a minimal reproducible example. Done means the intersected isobands contain no geometry outside the circular area and the intermittent result has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100