powered by
This function decodes the flexible polyline encoded line, changes the third dimension and encodes the line again.
set_third_dimension( encoded, third_dim_name, precision = 5L, third_dim_precision = 5L )
The line with the new third dimension as string in the flexible polyline encoding format.
character, encoded flexible polyline string.
character, name of the third dimension to set (ABSENT, LEVEL, ALTITUDE, ELEVATION, CUSTOM1, CUSTOM2).
integer, precision to use in encoding (between 0 and 15, default=5).
default=5
integer, precision to use in encoding for the third dimension (between 1 and 15, default=5).
# 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