Name

ST_LineFromEncodedPolyline — 인코딩된 폴리라인(polyline)으로부터 라인스트링을 생성합니다.

Synopsis

geometry ST_LineFromEncodedPolyline(text polyline, integer precision=5);

설명

인코딩된 폴리라인 스트링으로부터 라인스트링을 생성합니다.

Optional precision specifies how many decimal places will be preserved in Encoded Polyline. Value should be the same on encoding and decoding, or coordinates will be incorrect.

참조: http://developers.google.com/maps/documentation/utilities/polylinealgorithm

2.2.0 버전부터 사용할 수 있습니다.

예시

-- Create a line string from a polyline
SELECT ST_AsEWKT(ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@'));
-- result --
SRID=4326;LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252)

-- Select different precision that was used for polyline encoding
SELECT ST_AsEWKT(ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@',6));
-- result --
SRID=4326;LINESTRING(-12.02 3.85,-12.095 4.07,-12.6453 4.3252)