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

turf-nearest

Package Overview
Dependencies
Maintainers
9
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-nearest - npm Package Compare versions

Comparing version 3.0.10 to 3.0.12

4

index.js

@@ -10,4 +10,4 @@ var distance = require('turf-distance');

* @name nearest
* @param {Feature<Point>} point the reference point
* @param {FeatureCollection<Point>} against input point set
* @param {Feature<Point>} targetPoint the reference point
* @param {FeatureCollection<Point>} points against input point set
* @return {Feature<Point>} the closest point in the set to the reference point

@@ -14,0 +14,0 @@ * @example

{
"name": "turf-nearest",
"version": "3.0.10",
"version": "3.0.12",
"description": "turf nearest module",

@@ -30,4 +30,4 @@ "main": "index.js",

"dependencies": {
"turf-distance": "^3.0.10"
"turf-distance": "^3.0.12"
}
}
# turf-nearest
[![build status](https://secure.travis-ci.org/Turfjs/turf-nearest.png)](http://travis-ci.org/Turfjs/turf-nearest)
# nearest
turf nearest module
Takes a reference [point](Point) and a FeatureCollection of Features
with Point geometries and returns the
point from the FeatureCollection closest to the reference. This calculation
is geodesic.
**Parameters**
### `turf.nearest(point, against)`
- `targetPoint` **Feature&lt;Point>** the reference point
- `points` **FeatureCollection&lt;Point>** against input point set
Takes a reference Point|point and a set of points and returns the point from the set closest to the reference.
**Examples**
### Parameters
| parameter | type | description |
| --------- | ---------------------------- | ------------------- |
| `point` | Feature\.\<Point\> | the reference point |
| `against` | FeatureCollection\.\<Point\> | input point set |
### Example
```js
```javascript
var point = {

@@ -74,9 +68,15 @@ "type": "Feature",

Returns **Feature&lt;Point>** the closest point in the set to the reference point
**Returns** `Feature.<Point>`, the closest point in the set to the reference point
---
## Installation
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
Requires [nodejs](http://nodejs.org/).
### Installation
Install this module individually:
```sh

@@ -86,8 +86,6 @@ $ npm install turf-nearest

## Tests
Or install the Turf module that includes it as a function:
```sh
$ npm test
$ npm install turf
```
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