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
4
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 - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

2

main.js

@@ -42,3 +42,3 @@ 'use strict';

options = options || {};
if (!helpers.isObject(options)) throw new Error('options is invalid');
if (!helpers.isObject(options)) { throw new Error('options is invalid'); }

@@ -45,0 +45,0 @@ // validation

{
"name": "@turf/nearest-point-on-line",
"version": "5.0.4",
"version": "5.1.0",
"description": "turf nearest-point-on-line module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

@@ -12,3 +11,4 @@ "files": [

"index.d.ts",
"main.js"
"main.js",
"main.mjs"
],

@@ -18,3 +18,4 @@ "scripts": {

"test": "node -r @std/esm test.js",
"bench": "node -r @std/esm bench.js"
"bench": "node -r @std/esm bench.js",
"docs": "node ../../scripts/generate-readmes"
},

@@ -33,8 +34,9 @@ "repository": {

"@std/esm": "*",
"@turf/along": "^5.0.4",
"@turf/length": "^5.0.4",
"@turf/truncate": "^5.0.4",
"@turf/along": "^5.1.0",
"@turf/length": "^5.1.0",
"@turf/truncate": "^5.1.0",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*",

@@ -44,9 +46,9 @@ "write-json-file": "*"

"dependencies": {
"@turf/bearing": "^5.0.4",
"@turf/destination": "^5.0.4",
"@turf/distance": "^5.0.4",
"@turf/helpers": "^5.0.4",
"@turf/invariant": "^5.0.4",
"@turf/line-intersect": "^5.0.4",
"@turf/meta": "^5.0.4"
"@turf/bearing": "^5.1.0",
"@turf/destination": "^5.1.0",
"@turf/distance": "^5.1.0",
"@turf/helpers": "^5.1.0",
"@turf/invariant": "^5.1.0",
"@turf/line-intersect": "^5.1.0",
"@turf/meta": "^5.1.0"
},

@@ -53,0 +55,0 @@ "@std/esm": {

@@ -7,8 +7,8 @@ # @turf/nearest-point-on-line

Takes a [Point](http://geojson.org/geojson-spec.html#point) and a [LineString](http://geojson.org/geojson-spec.html#linestring) and calculates the closest Point on the (Multi)LineString.
Takes a [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) and a [LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) and calculates the closest Point on the (Multi)LineString.
**Parameters**
- `lines` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects)<([LineString](http://geojson.org/geojson-spec.html#linestring) \| [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring))>)** lines to snap to
- `pt` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects)<[Point](http://geojson.org/geojson-spec.html#point)> | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>)** point to snap from
- `lines` **([Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5))>)** lines to snap to
- `pt` **([Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)> | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>)** point to snap from
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`)

@@ -37,3 +37,3 @@ - `options.units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)

Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point.
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point.

@@ -40,0 +40,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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