turf-vincenty-inverse
turf distance module
turf.vincenty-inverse(from, to, units)
Vincenty's inverse formula computes the geographical distance and direction between two given points.
Parameters
parameter | type | description |
---|---|---|
from |
Feature.<Point> | origin point |
to |
Feature.<Point> | destination point |
[units=kilometers] |
String | optional: can be degrees, radians, miles, or kilometers |
Example
var point1 = "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": -75343 39984 ;var point2 = "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": -75534 39123 ;var units = "miles"; var points = "type": "FeatureCollection" "features": point1 point2; //=points var distance = turfvincenty-; //=distance
Returns Number
, distance between the two points
Installation
Requires nodejs.
$ npm install turf-vincenty-inverse
Tests
$ npm test