Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@turf/shortest-path
Advanced tools
Returns the shortest path from start to end without colliding with any Feature in obstacles
start
Coord point
end
Coord point
options
Object optional parameters (optional, default {}
)
options.obstacles
(Geometry | Feature | FeatureCollection<Polygon>)? areas which path cannot traveloptions.units
string unit in which resolution & minimum distance will be expressed in; it can be degrees, radians, miles, kilometers, ... (optional, default 'kilometers'
)options.resolution
number distance between matrix points on which the path will be calculated (optional, default 100
)var start = [-5, -6];
var end = [9, -6];
var options = {
obstacles: turf.polygon([[[0, -7], [5, -7], [5, -3], [0, -3], [0, -7]]])
};
var path = turf.shortestPath(start, end, options);
//addToMap
var addToMap = [start, end, options.obstacles, path];
Returns Feature<LineString> shortest path between start and end
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this single module individually:
$ npm install @turf/shortest-path
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf
FAQs
turf shortest-path module
The npm package @turf/shortest-path receives a total of 387,842 weekly downloads. As such, @turf/shortest-path popularity was classified as popular.
We found that @turf/shortest-path demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.