New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@here/flexpolyline

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@here/flexpolyline

Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
11K
-1.04%
Maintainers
3
Weekly downloads
 
Created
Source

Flexible Polyline encoding

The flexible polyline encoding is a lossy compressed representation of a list of coordinate pairs or coordinate triples.

For a detailed description, please visit GitHub.

Sample usage

To encode a polyline:

import { encode } from '@here/flexpolyline';

// Define an array of coordinates
const coordinates = [
    [50.1022829, 8.6982122],
    [50.1020076, 8.6956695],
    [50.1006313, 8.6914960],
    [50.0987800, 8.6875156]
];

// encode the polyline
const flexPolyline = encode({ polyline: coordinates });

// The output should be the flex polyline "BFoz5xJ67i1B1B7PzIhaxL7Y"
console.log(flexPolyline);

To decode a polyline:

import { decode } from '@here/flexpolyline';

// Use "decode" to get back the coordinates from the sample above
const decoded = decode(flexPolyline);
console.log(decoded.polyline);

License

Copyright (C) 2024 HERE Europe B.V.

See the LICENSE file in the root of this project for license details.

Keywords

polyline

FAQs

Package last updated on 20 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts