# time-aware-polyline

> time aware polyline hypertrack decode encode

Latest version **0.2.2** (published 2018-05-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install time-aware-polyline
pnpm add time-aware-polyline
yarn add time-aware-polyline
bun add time-aware-polyline
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2018-05-05 |
| First published | 2016-08-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arjun27, gaurav.mk, piyushgupta27, rishabhgrg |

## Links

- npm: https://www.npmjs.com/package/time-aware-polyline
- npm.io page: https://npm.io/package/time-aware-polyline

## Recent versions

- 0.2.2 (latest) — 2018-05-05
- 0.2.1 — 2018-05-05
- 0.2.0 — 2018-04-11
- 0.0.8 — 2018-03-01
- 0.0.6 — 2018-02-23
- 0.0.6-0 — 2018-02-23
- 0.0.5 — 2018-01-31
- 0.0.4 — 2018-01-24
- 0.0.3 — 2018-01-16
- 0.0.2 — 2018-01-12
- 0.0.2-0 — 2018-01-11
- 0.0.1 — 2018-01-11
- 0.1.19 — 2017-07-09
- 0.1.18 — 2017-01-23
- 0.1.17 — 2017-01-17
- … 15 more at https://npm.io/package/time-aware-polyline/versions

## README

# Time aware polylines in javascript
The google encoded [polyline algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) converts location coordinates into an ascii string. We have extended the algorithm to convert location coordinates with time stamps into ascii strings. The time aware polyline is also available in [python](https://github.com/hypertrack/time-aware-polyline-py).

[![npm version](https://badge.fury.io/js/time-aware-polyline.svg)](https://badge.fury.io/js/time-aware-polyline) [![Build Status](https://travis-ci.org/hypertrack/time-aware-polyline-js.svg?branch=master)](https://travis-ci.org/hypertrack/time-aware-polyline-js) [![Coverage Status](https://coveralls.io/repos/github/hypertrack/time-aware-polyline-js/badge.svg?branch=master)](https://coveralls.io/github/hypertrack/time-aware-polyline-js?branch=master)

Time aware polylines can be used to mark time events on polylines, or run a trip replay, like in the [HyperTrack dashboard](https://dashboard.hypertrack.io/demo).

![Polyline with events](https://bloghypertrack.files.wordpress.com/2016/08/xa95zckcqb.gif?w=760)

## Install
```
$ npm i time-aware-polyline
```

## Encoder
```javascript
var polylineUtil = require('time-aware-polyline');

var points = [
    [19.13626, 72.92506, '2016-07-21T05:43:09+00:00'],
    [19.13597, 72.92495, '2016-07-21T05:43:15+00:00'],
    [19.13553, 72.92469, '2016-07-21T05:43:21+00:00']
]
polylineUtil.encodeTimeAwarePolyline(points);
```

## Decoder

```javascript
var polylineUtil = require('time-aware-polyline');

var polyline = 'spxsBsdb|Lymo`qvAx@TKvAr@K';
polylineUtil.decodeTimeAwarePolyline(polyline);
```

## Testing
To run the tests, you will need to install npm. Use the following command to run the tests.

```
$ npm test
```

---
_Source: https://npm.io/package/time-aware-polyline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
