From 3c87c843eff7478fa3fdf01e66ed2efc1f442524 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Sat, 21 Jul 2018 12:16:46 +0000 Subject: [PATCH] Document precision in EncodedPolyline. Closes #3631 git-svn-id: http://svn.osgeo.org/postgis/trunk@16651 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_constructor.xml | 14 +++++++++++--- doc/reference_output.xml | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml index e2f2a01bf..e95ca01ea 100644 --- a/doc/reference_constructor.xml +++ b/doc/reference_constructor.xml @@ -1071,6 +1071,8 @@ SELECT Description 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 Availability: 2.2.0 @@ -1079,10 +1081,16 @@ SELECT Examples ---Create a line string from a polyline +-- Create a line string from a polyline SELECT ST_AsEWKT(ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@')); ---result-- -LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252) +-- 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) + diff --git a/doc/reference_output.xml b/doc/reference_output.xml index a9c7f747e..92204b973 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -126,8 +126,8 @@ Description - Returns the geometry as an Encoded Polyline. This is a format very useful if you are using google maps - + Returns the geometry as an Encoded Polyline. This format is used by Google Maps with precision=5 and by Open Source Routing Machine with precision=5 and 6. + 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. Availability: 2.2.0 -- 2.40.0