turf-bearing

turf bearing module

Turf packages are now namespaced: please use @turf/bearing instead
Last updated 10 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 (10 years ago)
  • 3.0.12                                ...           latest (10 years ago)

14 Versions

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

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