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. 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)该文章对您有帮助吗?