Learn R Programming

googlePolylines (version 0.8.7)

wkt_polyline: WKT Polyline

Description

Converts well-known text into encoded polylines.

Usage

wkt_polyline(obj)

Value

encoded polyline representation of geometries

Arguments

obj

sfencoded object or wkt_column of well-known text

Details

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

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)

## convert well-known text back to polylines
enc2 <- wkt_polyline(wkt)

}

Run the code above in your browser using DataLab