Learn R Programming

flexpolyline (version 0.3.0)

set_third_dimension: Set third dimension of a flexible polyline encoded string

Description

This function decodes the flexible polyline encoded line, changes the third dimension and encodes the line again.

Usage

set_third_dimension(
  encoded,
  third_dim_name,
  precision = 5L,
  third_dim_precision = 5L
)

Value

The line with the new third dimension as string in the flexible polyline encoding format.

Arguments

encoded

character, encoded flexible polyline string.

third_dim_name

character, name of the third dimension to set (ABSENT, LEVEL, ALTITUDE, ELEVATION, CUSTOM1, CUSTOM2).

precision

integer, precision to use in encoding (between 0 and 15, default=5).

third_dim_precision

integer, precision to use in encoding for the third dimension (between 1 and 15, default=5).

Examples

Run this code
# 2d line (nothing happens...)
set_third_dimension("BFoz5xJ67i1B1B7PzIhaxL7Y", "ELEVATION")

# 3d line
set_third_dimension("BlBoz5xJ67i1BU1B7PUzIhaUxL7YU", "ELEVATION")

Run the code above in your browser using DataLab