Opened 8 years ago
Closed 6 years ago
#3631 closed defect (fixed)
ST_LineFromEncodedPolyLine precision needs explanation
Reported by: | robe | Owned by: | komzpa |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.5.0 |
Component: | documentation | Version: | 2.2.x |
Keywords: | Cc: |
Description
In trying to debug why 32-bit winnie runs are failing, I came across this which made me wonder exactly what this precision argument is for.
SELECT ST_AsEWKT(ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@',5)); -- returns SRID=4326;LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252) SELECT ST_AsEWKT(ST_LineFromEncodedPolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@',6)); -- returns SRID=4326;LINESTRING(-12.02 3.85,-12.095 4.07,-12.6453 4.3252)
This is on my:
PostgreSQL 9.6rc1, compiled by Visual C++ build 1800, 64-bit POSTGIS="2.3.0rc1dev r15100" GEOS="3.5.0-CAPI-1.9.0 r4090" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.7.8" LIBJSON="0.12" (core procs from "2.3.0rc1dev r15096" need upgrade) RASTER (raster procs from "2.3.0rc1dev r15096" need upgrade)
It's not explained in docs, but as dbaston noted:
[12:42] <dbaston> robe2 I think the decoder needs to know what precision was used to create the encoded string [12:42] <dbaston> the encoded polyline is not self-describing [12:42] <dbaston> so if you decode with an incorrect precision, you get incorrect coordinates [12:42] <robe2> dbaston ah that explains it. I was beginning to think that [12:42] <robe2> not explained well in docs [12:43] <dbaston> well the precision parameter was actually ignored entirely in both the encoder and decoder, until a few days ago
Change History (6)
comment:1 by , 8 years ago
Milestone: | PostGIS 2.3.0 → PostGIS 2.4.0 |
---|
comment:2 by , 7 years ago
Owner: | changed from | to
---|
comment:3 by , 7 years ago
Milestone: | PostGIS 2.4.0 → PostGIS 2.5.0 |
---|
comment:4 by , 7 years ago
Owner: | changed from | to
---|
comment:5 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In 16651: