The flexpolyline R package provides a binding to the C++ implementation of the flexible polyline encoding by HERE. The flexible polyline encoding is a lossy compressed representation of a list of coordinate pairs or coordinate triples.
The encoding is achieved by:
Note:
Install the released version of flexpolyline from CRAN:
To install the development version from GitHub:
Encoding and decoding in R is straight forward by using
encode() and decode(). These functions are
binding to the flexpolyline C++ implementation and reflect the arguments
and return values of their counterparts
(hf::flexpolyline::polyline_encode and
hf::flexpolyline::polyline_decode):
The flexpolyline package integrates with the popular sf package for working with spatial data in R, which is built on the concept of simple features. The package provides additional functions for encoding and decoding sf objects directly: