1.0.1 • Published 9 years ago

turf-vincenty-inverse v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

turf-vincenty-inverse

Build Status

turf distance module

turf.vincenty-inverse(from, to, units)

Vincenty's inverse formula computes the geographical distance and direction between two given points.

Parameters

parametertypedescription
fromFeature.\<Point>origin point
toFeature.\<Point>destination point
[units=kilometers]Stringoptional: can be degrees, radians, miles, or kilometers

Example

var point1 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [-75.343, 39.984]
  }
};
var point2 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [-75.534, 39.123]
  }
};
var units = "miles";

var points = {
  "type": "FeatureCollection",
  "features": [point1, point2]
};

//=points

var distance = turf.vincenty-inverse(point1, point2, units);

//=distance

Returns Number, distance between the two points

Installation

Requires nodejs.

$ npm install turf-vincenty-inverse

Tests

$ npm test