[postgis-devel] [PostGIS] #348: [wktraster] st_raster_envelope & st_raster_to_box2d return different results

PostGIS trac at osgeo.org
Wed Dec 16 08:47:38 PST 2009


#348: [wktraster] st_raster_envelope & st_raster_to_box2d return different
results
------------------------+---------------------------------------------------
  Reporter:  pracine    |       Owner:  pracine        
      Type:  defect     |      Status:  assigned       
  Priority:  high       |   Milestone:  WKTRaster 0.1.6
 Component:  wktraster  |     Version:  trunk          
Resolution:             |    Keywords:                 
------------------------+---------------------------------------------------
Old description:

> SELECT ST_AsText(st_raster_envelope(rast)) FROM mytable
> UNION ALL
> SELECT ST_AsText(st_raster_to_box2d(rast)) FROM mytable
>
> should return two identical lines

New description:

 SELECT ST_AsText(st_raster_envelope(rast)) FROM mytable[[BR]]
 UNION ALL[[BR]]
 SELECT ST_AsText(st_raster_to_box2d(rast)) FROM mytable

 should return two identical lines.

Comment (by pracine):

 Reformated the query to make the two lines evident.

 This bug appears when the coordinates of the center upper left pixel are
 very precises i.e. -85.750000033333492

 A first problem is that the order is different.

 A second problem is that the numbers are also different when the precision
 is high. I guess this problem is related to the fact that bbox are stored
 as float4s in PostGIS and our version of ST_Envelope returns the float8s
 version. I think we should return the float4s bbox. I have to test further
 though.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/348#comment:3>
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-devel mailing list