decode_sf {flexpolyline}R Documentation

Wrapper function for decoding to simple features

Description

A wrapper function for decode that converts the input polylines, encoded in the flexible polyline enoding, to simple feature geometries of the sf package.

Usage

decode_sf(encoded, crs = sf::NA_crs_)

Arguments

encoded

character, encoded flexible polyline string.

crs

integer or character, coordinate reference system to assign to the sf object (default = sf::NA_crs_).

Value

An sf object, containing the geometries of the decoded lines (Geometry type: "LINESTRING").

Note

The function returns an sf object, therefore the input set of encoded polylines must be of consistent dimension (e.g "XY", "XYM" or "XYZ") to meet the requirements of the constructor of sf objects. For mixed dimensions use the decode function directly.

Examples

decode_sf("B1Voz5xJ67i1Bgkh9B")
decode_sf("BFoz5xJ67i1B1B7PlU9yB")
decode_sf("BlXoz5xJ67i1Bgkh9B1B7Pgkh9BzIhagkh9BqK-pB_ni6D")

[Package flexpolyline version 0.3.0 Index]