Constructs a LineString geometry from an encoded polyline string.
Syntax
geometry ST_LineFromEncodedPolyline(text polyline, integer precision);Parameters
| Parameter | Description |
|---|---|
polyline | The encoded string that represents the polyline. |
precision | The number of decimal places encoded in the polyline string. The encoding precision and decoding precision must match — mismatched values produce inaccurate coordinates. |
Usage notes
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'));Output:
st_astext
----------------------------------
LINESTRING(120 36,130 40,126 43)
(1 row)该文章对您有帮助吗?