[postgis-tickets] [PostGIS] #5070: TWKB: last point of the linearing hole of a polygon is lost when xyprecision > 0

PostGIS trac at osgeo.org
Fri Jan 28 01:34:17 PST 2022


#5070: TWKB: last point of the linearing hole of a polygon is lost when
xyprecision > 0
---------------------+---------------------------
 Reporter:  murdos   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.3.0
Component:  postgis  |    Version:  2.5.x
 Keywords:           |
---------------------+---------------------------
 Might be related to https://trac.osgeo.org/postgis/ticket/4461

 "POLYGON((0 0,0 10,10 10,0 0),(1 1,1 2,2 2,2 1,1 1))" becomes "POLYGON((0
 0,0 0,0 0,0 0),(0 0,0 0,0 0,0 0))" (note the missing 5th point of the hole
 of the polygon) when you apply **ST_AsTWKB** then **ST_GeomFromTWKB**.

 It works as expected in version 2.5.2, and the defects is present in
 2.5.5, 3.0.3, 3.1.4 and 3.2.0.

 It can be reproduced with:
 {{{
 select
         inputwkt,
         ST_AsText(ST_GeomFromTWKB(ST_AsTWKB(inputwkt::geometry,
 xyprecision, 5, 5, false, false))) as reverted_wkt_from_twkb,
         xyprecision
 from (select 'POLYGON((0 0,0 10,10 10,0 0),(1 1,1 2,2 2,2 1,1 1))'::text
 as inputwkt) xx
 cross join generate_series(0, 7) as xyprecision
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5070>
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