ST_AsEncodedPolyline

Updated at:

Returns the encoded polyline representation of a LineString geometry.

Syntax

text ST_AsEncodedPolyline(geometry geom, integer precision);

Parameters

ParameterDescription
geomThe LineString geometry to encode.
precisionThe number of decimal places to retain in the encoded output. Default value: 5. Use the same precision value for both encoding and decoding — mismatched precision produces incorrect coordinates.

Example

SELECT ST_AsEncodedPolyline(GeomFromEWKT('SRID=4326;LINESTRING(120 36,130 40,126 43)'));

Output:

    st_asencodedpolyline
-----------------------------
 _gvzE_ol{U_glW_c`|@_}hQ~flW
(1 row)