Gathering detailed insights and metrics for trajectory.js
Gathering detailed insights and metrics for trajectory.js
Gathering detailed insights and metrics for trajectory.js
Gathering detailed insights and metrics for trajectory.js
Trajectory data lossy compression/serialization library based on Google's Encoded Polyline Algorithm Format
npm install trajectory.js
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (99.62%)
Makefile (0.38%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
BSD-3-Clause License
5 Stars
90 Commits
2 Watchers
1 Branches
14 Contributors
Updated on Feb 08, 2022
Latest Version
0.1.2
Package Id
trajectory.js@0.1.2
Unpacked Size
15.53 kB
Size
5.89 kB
File Count
12
NPM Version
6.14.5
Node Version
14.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A simple google-esque polyline inspired
implementation in Javascript, extended to trajectory data structure (an additional time dimension added to the GPS coordinates). Compatible with nodejs (npm install trajectory.js
and the browser (copy src/trajectory.js
)).
Encodes from/decodes into [lat, lng, unix time in seconds]
tuples.
This library is heavily based on https://github.com/mapbox/polyline (In fact it is built on top of fork of it)
npm install trajectory.js
1var trajectory = require('trajectory.js'); 2 3// returns an array of (lat, lon, unix time in seconds) tuples 4trajectory.decode('_p~iF~ps|U_ynpijgz~G_ulLnnqC_c`|@_mqNvxq`@__t`B'); 5 6// returns an array of (lat, lon, unix time in seconds) tuples from trajectory6 by passing a precision parameter 7trajectory.decode('_izlhA~rlgdF_c}mhpro}xA_{geC~ywl@_gjaR_kwzCn`{nI__qo]', 6); 8 9// returns a string-encoded trajectory 10trajectory.encode([[38.5, -120.2, 1582482601], [40.7, -120.95, 1582482611], [43.252, -126.453, 1582482627]]); 11
Takes a string representation of 1+ coordinate pairs and returns an array of (lat, lon, unix time in seconds) arrays. If not specified, precision defaults to 5.
Takes an array of (lat, lon, unix time in seconds) arrays and returns an encoded string. If not specified, precision defaults to 5.
Install globally or run ./node_modules/.bin/trajectory
.
Send input via stdin and use --decode
, --encode
flags. If omitted will default to --decode
.
Example :
1$ echo '_p~iF~ps|U_ynpijgz~G_ulLnnqC_c`|@_mqNvxq`@__t`B' | ./bin/trajectory.bin.js 2 3$ echo '[[38.5,-120.2,1582482601],[40.7,-120.95,1582482611],[43.252,-126.453,1582482627]]' | ./bin/trajectory.bin.js --encode
Issues and pull requests are welcome.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More