[postgis-tickets] r16651 - Document precision in EncodedPolyline.
Darafei
komzpa at gmail.com
Sat Jul 21 05:16:46 PDT 2018
Author: komzpa
Date: 2018-07-21 05:16:46 -0700 (Sat, 21 Jul 2018)
New Revision: 16651
Modified:
trunk/doc/reference_constructor.xml
trunk/doc/reference_output.xml
Log:
Document precision in EncodedPolyline.
Closes #3631
Modified: trunk/doc/reference_constructor.xml
===================================================================
--- trunk/doc/reference_constructor.xml 2018-07-21 11:56:35 UTC (rev 16650)
+++ trunk/doc/reference_constructor.xml 2018-07-21 12:16:46 UTC (rev 16651)
@@ -1071,6 +1071,8 @@
<title>Description</title>
<para>Creates a LineString from an Encoded Polyline string.</para>
+ <para>Optional <varname>precision</varname> 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.</para>
+
<para>See http://developers.google.com/maps/documentation/utilities/polylinealgorithm</para>
<para>Availability: 2.2.0</para>
</refsection>
@@ -1079,10 +1081,16 @@
<title>Examples</title>
<programlisting>
---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)
+
</programlisting>
</refsection>
Modified: trunk/doc/reference_output.xml
===================================================================
--- trunk/doc/reference_output.xml 2018-07-21 11:56:35 UTC (rev 16650)
+++ trunk/doc/reference_output.xml 2018-07-21 12:16:46 UTC (rev 16651)
@@ -126,9 +126,9 @@
<refsection>
<title>Description</title>
- <para>Returns the geometry as an Encoded Polyline. This is a format very useful if you are using google maps</para>
+ <para>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.</para>
+ <para>Optional <varname>precision</varname> 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.</para>
-
<para>Availability: 2.2.0</para>
</refsection>
More information about the postgis-tickets
mailing list