Socket
Socket
Sign inDemoInstall

@turf/nearest-point

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/nearest-point

turf nearest-point module


Version published
Weekly downloads
488K
increased by7.34%
Maintainers
4
Weekly downloads
 
Created

What is @turf/nearest-point?

@turf/nearest-point is a module within the Turf.js library that provides geospatial analysis tools. This specific module is used to find the nearest point from a given set of points to a reference point. It is useful in various applications such as finding the closest facility, nearest neighbor analysis, and more.

What are @turf/nearest-point's main functionalities?

Find the nearest point

This feature allows you to find the nearest point from a collection of points to a given target point. The code sample demonstrates how to create a collection of points and a target point, and then find the nearest point using the `nearestPoint` function.

const turf = require('@turf/turf');

const points = turf.featureCollection([
  turf.point([0, 0]),
  turf.point([2, 2]),
  turf.point([3, 3])
]);
const targetPoint = turf.point([1, 1]);

const nearest = turf.nearestPoint(targetPoint, points);
console.log(nearest);

Other packages similar to @turf/nearest-point

Keywords

FAQs

Package last updated on 10 Dec 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc