Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stepankuzmin/turf-arc
Calculate great circles routes as lines
https://github.com/stepankuzmin/turf-arc
arc great-circle javascript turfjs
Last synced: 18 days ago
JSON representation
Calculate great circles routes as lines
- Host: GitHub
- URL: https://github.com/stepankuzmin/turf-arc
- Owner: stepankuzmin
- Created: 2016-06-21T10:30:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-26T11:28:47.000Z (over 5 years ago)
- Last Synced: 2024-11-22T02:09:25.207Z (about 1 month ago)
- Topics: arc, great-circle, javascript, turfjs
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# turf-arc
[![build status](https://secure.travis-ci.org/stepankuzmin/turf-arc.png)](http://travis-ci.org/stepankuzmin/turf-arc)
[![Greenkeeper badge](https://badges.greenkeeper.io/stepankuzmin/turf-arc.svg)](https://greenkeeper.io/)Calculate great circles routes as lines
### `turf.arc(from, to, properties, npoints, options.offset)`
Calculate great circles routes as lines
### Parameters
| parameter | type | description |
| ---------------- | ------ | ------------------------------- |
| `from` | Object | source point feature |
| `to` | Object | destination point feature |
| `properties` | Object | line feature properties |
| `npoints` | Number | number of points |
| `options.offset` | Object | offset from dateline in degrees |### Example
```js
var arc = require('turf-arc');
var from = { type: 'Point', coordinates: [-122, 48] };
var to = { type: 'Point', coordinates: [-77, 39] };
var line = arc(from, to, { 'name': 'Seattle to DC' }, 100, { offset: 10 });
//=line
```**Returns** `Object`, arc line feature
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install turf-arc
```## Tests
```sh
$ npm test
```