This function calls hf::polyline_decode and hf::get_third_dimension of the C++ implementation of the flexible polyline encoding by HERE. Depending on the dimensions of the encoded line, a two or three-dimensional line is decoded.

decode(encoded)

Arguments

encoded

character, encoded flexible polyline string.

Value

A matrix containing the coordinates of the decoded line.

Examples

# 2d line
decode("BFoz5xJ67i1B1B7PzIhaxL7Y")
#>          LNG      LAT
#> [1,] 8.69821 50.10228
#> [2,] 8.69567 50.10201
#> [3,] 8.69150 50.10063
#> [4,] 8.68752 50.09878

# 3d line
decode("BlBoz5xJ67i1BU1B7PUzIhaUxL7YU")
#>          LNG      LAT ALTITUDE
#> [1,] 8.69821 50.10228       10
#> [2,] 8.69567 50.10201       20
#> [3,] 8.69150 50.10063       30
#> [4,] 8.68752 50.09878       40