ST_LineFromEncodedPolyline

更新时间:
复制 MD 格式

Constructs a LineString geometry from an encoded polyline string.

Syntax

geometry ST_LineFromEncodedPolyline(text polyline, integer precision)

Parameters

ParameterDescription
polylineThe encoded string that represents the polyline.
precisionThe number of decimal places encoded in the polyline. The precision used for encoding and decoding must match; otherwise, the resulting coordinates are inaccurate.

Description

This function uses the Encoded Polyline Algorithm Format defined by Google Maps.

Examples

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