Nazwa

ST_LineFromEncodedPolyline — Creates a LineString from an Encoded Polyline.

Streszczenie

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

Opis

Creates a LineString from an Encoded Polyline string.

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.

See http://developers.google.com/maps/documentation/utilities/polylinealgorithm

Dostępność: 2.0.0

Przykłady

This example creates a LineString from a polyline.

Code
SELECT ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@');
Output
SRID=4326;LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252)
Figure
Geometry figure for visual-st-linefromencodedpolyline-01

This example selects a different precision than the one used for polyline encoding.

Code
SELECT ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@', 6);
Output
SRID=4326;LINESTRING(-12.02 3.85,-12.095 4.07,-12.6453 4.3252)

    
Figure
Geometry figure for visual-st-linefromencodedpolyline-02

Zobacz także

ST_AsEncodedPolyline