[postgis-devel] [PostGIS] #1023: pglwgeom_ (was: btree equality broken for geometries w/out a cached bounding box (topology regress failures related to GSERIALIZED))

PostGIS trac at osgeo.org
Mon Jul 4 07:54:11 PDT 2011


#1023: pglwgeom_
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  high     |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by strk):

 So, turns out the actually used functions _are_ documented, only they are
 not compatible:

 {{{
 /*
  * this function writes to 'box' and returns 0 if serialized_form
  * does not have a bounding box (empty geom)
  */
 extern int getbox2d_p(uchar *serialized_form, BOX2DFLOAT4 *box);

 /**
 * Pull a #GBOX from the header of a #GSERIALIZED, if one is available. If
 * it is not, return LW_FAILURE.
 */
 extern int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox);

 int pglwgeom_getbox2d_p(const PG_LWGEOM *geom, BOX2DFLOAT4 *box)
 {
 #ifdef GSERIALIZED_ON
         return gserialized_get_gbox_p(geom, box);
 #else
         return getbox2d_p(SERIALIZED_FORM(geom), box);
 #endif
 }
 }}}

 So basically pglwgeom_getbox2d_p is using one or the other function but
 while one returns a bounding box if NON-empty the other only returns it if
 CACHED.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1023#comment:10>
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