Use geokdbush for @turf/nearest-point
Open
Nobody has claimed this yet.
@turf/nearest-point
performance
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Use geokdbush for @turf/nearest-point
Seems like @turf/nearest-point could have a significant performance increase by leveraging @mourner's geokdbush.
Current code of @turf/nearest-point
function nearest(targetPoint, points) {
var nearestPoint, minDist = Infinity;
for (var i = 0; i < points.features.length; i++) {
var distanceToPoint = distance(targetPoint, points.features[i]);
if (distanceToPoint < minDist) {
nearestPoint = points.features[i];
minDist = distanceToPoint;
}
}
return nearestPoint;
}
Dependent modules
@turf/point-on-surface
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 with the current nearest-point implementation shown in the issue and review how geokdbush provides nearest-point lookup. Check the dependent @turf/point-on-surface module for compatibility. Done means @turf/nearest-point uses geokdbush while preserving its existing result behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100