Gathering detailed insights and metrics for @mapbox/polyline
Gathering detailed insights and metrics for @mapbox/polyline
Gathering detailed insights and metrics for @mapbox/polyline
Gathering detailed insights and metrics for @mapbox/polyline
polyline encoding and decoding in javascript
npm install @mapbox/polyline
86.5
Supply Chain
83.4
Quality
82.4
Maintenance
100
Vulnerability
98.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
646 Stars
115 Commits
102 Forks
135 Watching
3 Branches
552 Contributors
Updated on 24 Nov 2024
Minified
Minified + Gzipped
JavaScript (99.69%)
Makefile (0.31%)
Cumulative downloads
Total Downloads
Last day
-27%
35,394
Compared to previous day
Last week
-7.6%
234,170
Compared to previous week
Last month
1.1%
1,060,444
Compared to previous month
Last year
18.2%
11,366,013
Compared to previous year
A simple google-esque polyline
implementation in Javascript. Compatible with nodejs (npm install @mapbox/polyline
and the browser (copy src/polyline.js
)).
Encodes from / decodes into [lat, lng]
coordinate pairs. Use fromGeoJSON()
to encode from GeoJSON objects, or toGeoJSON
to
decode to a GeoJSON LineString.
npm install @mapbox/polyline
Note that the old package polyline
has been deprecated in favor of @mapbox/polyline
(the old package remain but won't receive updates).
1var polyline = require('@mapbox/polyline'); 2 3// returns an array of lat, lon pairs 4polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); 5 6// returns an array of lat, lon pairs from polyline6 by passing a precision parameter 7polyline.decode('cxl_cBqwvnS|Dy@ogFyxmAf`IsnA|CjFzCsHluD_k@hi@ljL', 6); 8 9// returns a GeoJSON LineString Geometry 10polyline.toGeoJSON('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); 11 12// returns a string-encoded polyline (from coordinate ordered lat,lng) 13polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]); 14 15// returns a string-encoded polyline from a GeoJSON LineString 16polyline.fromGeoJSON({ "type": "Feature", 17 "geometry": { 18 "type": "LineString", 19 "coordinates": [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] 20 }, 21 "properties": {} 22}); 23
Install globally or run ./node_modules/.bin/polyline
.
Send input via stdin and use --decode
, --encode
, --toGeoJSON
, or --fromGeoJSON
flags. If omitted will default to --decode
.
Example :
cat file.json | ./bin/polyline.bin.js --fromGeoJSON > result.txt
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 9/13 approved changesets -- score normalized to 6
Reason
branch protection is not maximal on development and all release branches
Details
Reason
5 existing vulnerabilities detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-25
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