-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
53 lines (39 loc) · 1.37 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# gepaf
<!-- badges: start -->
[![CRAN](https://www.r-pkg.org/badges/version-ago/gepaf)](https://cran.r-project.org/package=gepaf)
[![status](https://tinyverse.netlify.app/badge/gepaf)](https://CRAN.R-project.org/package=gepaf)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
<!-- badges: end -->
The goal of gepaf is to encode and decode the Google Encoded Polyline Algorithm Format.
## Example
**Encoding**
```{r}
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
```
**Decoding**
```{r}
coords <- decodePolyline(enc_polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@")
coords
```
## 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](https://www.npmjs.com/package/polyline) one)
## Alternative
- [`googlePolylines`](https://CRAN.R-project.org/package=googlePolylines)