This topic describes the ST_LineFromEncodedPolyline function. This function constructs a LineString object by using an encoded string that represents a polyline.

Syntax

geometry  ST_LineFromEncodedPolyline(text  polyline , integer  precision);

Parameters

Parameter Description
polyline The encoded string that represents the polyline.
precision The precision that specifies how many decimal places in the polyline are retained. The precision of encoding and the precision of decoding must be the same. Otherwise, coordinates are inaccurate.

Description

For more information about the encoding format that is used by this function, see Encoded Polyline Algorithm Format.

Examples

SELECT ST_AsText(ST_LineFromEncodedPolyline('_gvzE_ol{U_glW_c`|@_}hQ~flW'));
            st_astext
----------------------------------
 LINESTRING(120 36,130 40,126 43)
(1 row)