encodePolyline: Encode Coordinates to Google Polylines

Description Usage Arguments Value Examples

View source: R/gepaf.R

Description

Encode a data.frame of coordinates to a Google polyline.

Usage

1
encodePolyline(df_coords, factor = 5)

Arguments

df_coords

a data frame of coordinates with two columns: latitudes and longitudes. Coordinates must be in decimal degrees (WGS84).

factor

number of decimal digits to be used.

Value

An encoded polyline is returned.

Examples

1
2
3
4
coords <- data.frame(lat = c(38.5, 40.7, 43.252),
                     lon = c(-120.2, -120.95, -126.453))
encpoly <- encodePolyline(coords)
encpoly

Example output

[1] "_p~iF~ps|U_ulLnnqC_mqNvxq`@"

gepaf documentation built on May 2, 2019, 3:39 p.m.