Skip to content

Encoder and decoder for time aware polyline in javascript

License

Notifications You must be signed in to change notification settings

manjabes/time-aware-polyline-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time aware polylines in javascript

The google encoded polyline algorithm 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.

npm version Build Status Coverage Status

Time aware polylines can be used to mark time events on polylines, or run a trip replay, like in the HyperTrack dashboard.

Polyline with events

Install

$ npm i time-aware-polyline

Encoder

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

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

About

Encoder and decoder for time aware polyline in javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%