[postgis-tickets] [PostGIS] #5357: Invalid conversion of 2-points line in ST_LineFromEncodedPolyline

PostGIS trac at osgeo.org
Mon Mar 20 08:19:21 PDT 2023


#5357: Invalid conversion of 2-points line in ST_LineFromEncodedPolyline
----------------------------------------+--------------------------------
 Reporter:  perikrone                   |      Owner:  pramsey
     Type:  defect                      |     Status:  new
 Priority:  medium                      |  Milestone:  PostGIS PostgreSQL
Component:  postgis                     |    Version:  3.2.x
 Keywords:  ST_LineFromEncodedPolyline  |
----------------------------------------+--------------------------------
 In cases when encoded polyline consists of two points located close to
 each other ST_LineFromEncodedPolyline returns single point instead of
 pair. Example:
 {{{
 SELECT st_astext(ST_LineFromEncodedPolyline('__nphBgcoeiA?@', 6));
             st_astext
 ---------------------------------
  LINESTRING(38.903876 55.336448)
 }}}

 But if you try to convert this polyline in python, script results in
 correct pair of points. Python script:
 {{{
 import polyline

 shape = polyline.decode("__nphBgcoeiA?@", precision=6)
 print(rose_shape)
 }}}
 Result:
 {{{
 [[38.903876, 55.336448], [38.903875, 55.336448]]
 }}}

 Info about postgres and postgis:
 {{{
 SELECT PostGIS_Full_Version();

 POSTGIS="3.2.2 628da50" [EXTENSION] PGSQL="140" GEOS="3.10.3-CAPI-1.16.1"
 PROJ="8.2.1" GDAL="GDAL 3.4.3, released 2022/04/22" LIBXML="2.9.7"
 LIBJSON="0.13.1" LIBPROTOBUF="1.3.0" WAGYU="0.5.0 (Internal)" RASTER

 SELECT version();
 PostgreSQL 14.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0
 20210514 (Red Hat 8.5.0-10), 64-bit
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5357>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list