polyline_wkt: Polyline WKT

View source: R/wkt.R

polyline_wktR Documentation

Polyline WKT

Description

Converts encoded polylines into well-known text.

Usage

polyline_wkt(obj)

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.

Value

well-known text representation of the encoded polylines

Note

This will not work if you have specified strip = TRUE for encode()

Examples

## Not run: 

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)


## End(Not run)


googlePolylines documentation built on Oct. 30, 2024, 9:29 a.m.