Interpolate should bail early if an exact distance match is found
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Is there a logic error in the fast path of the following code? If the certeroid in interpolate is an exact match zw is set to the value of the feature but the forEach loop is not aborted.
This means that we should have a different result depending on which order the points are checked. If the point is found at the end of the feature set the zValue will be taken from the feature, if it's one of the first points it would just be accounted for as normal.
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 linked fast-path code in packages/turf-interpolate/index.js around lines 94–95 and inspect how an exact distance match is handled inside the forEach loop. Verify the behavior with points in different orders, then confirm that an exact match consistently determines the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100