ST_AsEncodedPolyline
Updated at:
Returns the encoded polyline representation of a LineString geometry.
Syntax
text ST_AsEncodedPolyline(geometry geom, integer precision);Parameters
| Parameter | Description |
|---|---|
geom | The LineString geometry to encode. |
precision | The 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)Is this page helpful?