[postgis-tickets] [PostGIS] #3034: ST_AsTWKBagg does not check the input precision

PostGIS trac at osgeo.org
Wed Feb 11 11:01:20 PST 2015


#3034: ST_AsTWKBagg does not check the input precision
-------------------------+--------------------------------------------------
 Reporter:  javisantana  |       Owner:  pramsey
     Type:  defect       |      Status:  new    
 Priority:  medium       |   Milestone:         
Component:  postgis      |     Version:  2.1.x  
 Keywords:               |  
-------------------------+--------------------------------------------------
 running the following query


 {{{
 test_postgis=# select ST_AsTWKBagg(st_makepoint(10,10), 10) from
 generate_series(1, 10);
 ERROR:  Output TWKB is not the same size as the allocated buffer
 (precalculated size:31, allocated size:33)
 }}}

 if you use st_astwkb you get

 {{{
 test_postgis=# select ST_AsTWKB(st_makepoint(10,10), 10);
 ERROR:  precision cannot be more than 7
 }}}

 ST_AsTWKBagg method lacks of checking (see attached path) but I'm pretty
 sure that check should be done at encoding level.

 Also I'm not sure why the precision is limited to 7

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