Learn R Programming

stplanr (version 0.4.0)

decode_gl: Decode Google polyline compressed string

Description

Decode Google polyline compressed string

Usage

decode_gl(polyline, precision = 6, forceline = TRUE)

Arguments

polyline

A character string or vector of character strings containing the encoded polyline to be decoded.

precision

An integer indicating the number of decimals in the initial encoded coordinates. Default is 6 (for OSRM default).

forceline

Boolean value indicating if the returned coordinates should be a line (i.e., minimum two points) Default is TRUE.

Details

An implementation of the Google Maps Encoded Polyline Algorithm for decoding strings. Returns a dataframe if polyline is of length 1 and a list of dataframes otherwise.

See the more recent googlePolylines package, which is faster: https://github.com/SymbolixAU/googlePolylines

See Also

Other geo: bbox_scale, buff_geo, crs_select_aeq, gclip, geo_bb_matrix, geo_bb, mapshape_available, mapshape, quadrant, reproject

Examples

Run this code
# NOT RUN {
decode_gl("_p~iF~ps|U_ulLnnqC_mqNvxq`@", precision = 5)
# }

Run the code above in your browser using DataLab