Learn R Programming

googlePolylines (version 0.8.7)

polyline_wkt: Polyline WKT

Description

Converts encoded polylines into well-known text.

Usage

polyline_wkt(obj)

Value

well-known text representation of the encoded polylines

Arguments

obj

sfencoded object or encoded_column of encoded polylines

Details

'Polylines' refers to lat/lon coordinates encoded into strings using Google's polyline encoding algorithm.

The function assumes Google Web Mercator projection (WSG 84 / EPSG:3857 / EPSG:900913) for inputs and outputs.

Examples

Run this code
if (FALSE) {

library(sf)
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"))

## encode to polylines
enc <- encode(nc)

## convert encoded lines to well-known text
wkt <- polyline_wkt(enc)

}

Run the code above in your browser using DataLab