turf-bearing

turf bearing module

Turf packages are now namespaced: please use @turf/bearing instead
Last updated 8 years ago by tmcw .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install turf-bearing 
SYNC missed versions from official npm registry.

turf-bearing

build status

turf bearing module

turf.bearing(start, end)

Takes two Point|points and finds the geographic bearing between them.

Parameters

parameter type description
start Feature.<Point> starting Point
end Feature.<Point> ending Point

Example

var point1 = {
  "type": "Feature",
  "properties": {
    "marker-color": '#f00'
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-75.343, 39.984]
  }
};
var point2 = {
  "type": "Feature",
  "properties": {
    "marker-color": '#0f0'
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-75.534, 39.123]
  }
};

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

//=points

var bearing = turf.bearing(point1, point2);

//=bearing

Returns Number, bearing in decimal degrees

Installation

Requires nodejs.

$ npm install turf-bearing

Tests

$ npm test

Current Tags

  • 3.0.7-canary.ae89c8b3                                ...           canary (8 years ago)
  • 3.0.12                                ...           latest (8 years ago)

14 Versions

  • 3.0.12 [deprecated]           ...           8 years ago
  • 3.0.10 [deprecated]           ...           8 years ago
  • 3.0.7-canary.ae89c8b3                                ...           8 years ago
  • 3.0.7 [deprecated]           ...           8 years ago
  • 3.0.6 [deprecated]           ...           8 years ago
  • 3.0.5-canary.4f73aa1a                                ...           8 years ago
  • 3.0.1 [deprecated]           ...           8 years ago
  • 3.0.0-canary.7879bf6c                                ...           8 years ago
  • 3.0.0-canary.2f5f7167                                ...           8 years ago
  • 1.0.2 [deprecated]           ...           9 years ago
  • 1.0.1 [deprecated]           ...           10 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
  • 0.0.2 [deprecated]           ...           10 years ago
  • 0.0.1 [deprecated]           ...           10 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE