@turf/isobands generates wrong inner circle
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
I'm trying to use isobands, but sometime got incorrect result.
Example:
Cyan (985) polygon expected to be one polygon with hole, but it generated two polygons without holes.
Grid points:
Code for reproduce:
fetch("../point.json")
.then((res) => res.text())
.then((text) => {
const pointGrid = JSON.parse(text);
const breaks = [
965, 970, 975, 980, 985, 990, 995, 1000, 1005, 1010, 1015, 1020, 1025,
1030, 1035, 1040,
];
let result = turf.isobands(pointGrid, breaks, {
zProperty: "value",
});
console.log(result);
});
If manualy replace two polygons with one, it turns out well.
result.features[4].geometry.coordinates = [[result.features[4].geometry.coordinates[1][0], result.features[4].geometry.coordinates[0][0]]]
My raw data attached
point.json
isobands.json
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 turf.isobands entry point and reproduce the report with the attached point.json and breaks array; compare the generated isobands.json with the screenshots and stated expected geometry. Trace how the 985 band is assembled, and consider the issue done when that band is one polygon with an inner hole without manual coordinate replacement and the other bands remain correct.
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
- Mostly clear
- Newbie friendliness
- 35/100