[postgis-tickets] [PostGIS] #5072: ST_GeomFromTWKB rounding issue with negative xyprecision

PostGIS trac at osgeo.org
Fri Jan 28 14:53:54 PST 2022


#5072: ST_GeomFromTWKB rounding issue with negative xyprecision
---------------------+---------------------------
 Reporter:  murdos   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.3.0
Component:  postgis  |    Version:  3.1.x
 Keywords:           |
---------------------+---------------------------
 Consider the following query:
 {{{
 select
         ST_AsText(ST_GeomFromTWKB(ST_AsTWKB(inputwkt::geometry,
 xyprecision, 5, 5, false, false))) as reverted_wkt_from_twkb,
         xyprecision,
         encode(ST_AsTWKB(inputwkt::geometry, xyprecision, 5, 5, false,
 false), 'hex')
 from (select 'POINT (12345678.12345678 -12345678.12345678)'::text as
 inputwkt) xx
 cross join generate_series(-5, -5) as xyprecision
 }}}

 With postgis 3.1.4 or 3.2.0 it returns:
 {{{
 POINT(12299999.999999998 -12299999.999999998)   -5      9100f601f501}}}
 }}}

 With postgis 3.0.4 it returns:
 {{{
 POINT(12300000 -12300000)       -5      9100f601f501
 }}}

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