turf-nearest
Advanced tools
Comparing version 3.0.10 to 3.0.12
@@ -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<Point>** the reference point | ||
- `points` **FeatureCollection<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<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 | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8550
90
Updatedturf-distance@^3.0.12