Google Encoded Polyline Algorithm Format

Encode and decode the Google Encoded Polyline Algorithm Format. See < https://developers.google.com/maps/documentation/utilities/polylinealgorithm> for more information.


gepaf

CRAN status Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped.

The goal of gepaf is to encode and decode the Google Encoded Polyline Algorithm Format.

Example

Encoding

library(gepaf)
coords <- data.frame(
  lat = c(38.5, 40.7, 43.252),
  lon = c(-120.2, -120.95, -126.453)
)
encpoly <- encodePolyline(coords)
encpoly
#> [1] "_p~iF~ps|U_ulLnnqC_mqNvxq`@"

Decoding

coords <- decodePolyline(enc_polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@")
coords
#>      lat      lon
#> 1 38.500 -120.200
#> 2 40.700 -120.950
#> 3 43.252 -126.453

References :

Mostly a translation of https://github.com/mthh/polyline_ggl/ (itself a modest translation of other well known available implementations such as Node.js Mapbox one)

Alternative

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gepaf")

0.2.0 by Timothée Giraud, 2 years ago


https://github.com/riatelab/gepaf


Report a bug at https://github.com/riatelab/gepaf/issues


Browse source code at https://github.com/cran/gepaf


Authors: Matthieu Viry [aut] , Timothée Giraud [ctb, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports bitops

Suggests tinytest


See at CRAN