Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/nearest-point-on-line

Package Overview
Dependencies
Maintainers
9
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/nearest-point-on-line

turf nearest-point-on-line module

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
increased by21.43%
Maintainers
9
Weekly downloads
 
Created

What is @turf/nearest-point-on-line?

@turf/nearest-point-on-line is a module from the Turf.js library that allows you to find the nearest point on a line from a given point. This can be useful in various geospatial analyses, such as snapping a point to a road network or finding the closest point of interest along a path.

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

Find Nearest Point on Line

This feature allows you to find the nearest point on a given line from a specified point. In the code sample, a line and a point are defined, and the nearest point on the line to the given point is calculated and logged.

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

const line = turf.lineString([[0, 0], [2, 2], [3, 3]]);
const point = turf.point([1, 2]);
const snapped = turf.nearestPointOnLine(line, point);

console.log(snapped);

Other packages similar to @turf/nearest-point-on-line

FAQs

Package last updated on 09 Aug 2024

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