[postgis-tickets] [PostGIS] #2262: autocast to box causing issues with removed functions

PostGIS trac at osgeo.org
Wed Apr 3 16:37:28 PDT 2013


#2262: autocast to box causing issues with removed functions
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.4
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------
 Bruce Rindahl pointed out to me that he was in the habit of using the

 area function and when he upgraded to 2.0, he could still use the area
 function, but it was now returning a different answer from ST_Area.  I
 think the wrong answer.  I did a test myself on a pure 2.0 install, and
 came up with the same disturbing answer.  Seems our geometries are falling
 into the built in box type is my guess and enjoying te fruits of using box
 area functions.

 Demonstration:


 {{{
 select st_area(ST_Buffer(ST_MakeEnvelope(1,2,3,4),1)) As our_area,
 area(ST_Buffer(ST_MakeEnvelope(1,2,3,4),1)) As our_geom_found_in_box,
 area(ST_Buffer(ST_MakeEnvelope(1,2,3,4),1)) As explicit_cast_box

 }}}

 All kinda disturbing:


 {{{
      our_area     | our_geom_found_in_box | explicit_cast_box
 ------------------+-----------------------+-------------------
  15.1214451522581 |                    16 |                16
 }}}


 I suppose we could just bring back area and length to prevent this from
 happening.  I suspect those might be the only two.

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