<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText64499 dir=ltr>
<DIV dir=ltr>Also noticed we have this same exercise repeated for touches, crosses, covers, within, disjoint.  I guess pretty much any function where we would normally do an && in PostgreSQL before it hits these functions.</DIV></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>The only place it doesn't seem redundant is in disjoint, but then again why don't we have disjoint using && in PostgreSQL.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>wouldn't we just restate ST_Disjoint to use indexes by doing the below</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><BR> SELECT  NOT ($1 && $2)  OR _st_disjoint($1, $2) </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Thanks,</DIV>
<DIV dir=ltr>Regina</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><BR> </DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>From:</B> postgis-devel-bounces@postgis.refractions.net on behalf of Obe, Regina<BR><B>Sent:</B> Mon 9/8/2008 3:14 PM<BR><B>To:</B> postgis-devel@postgis.refractions.net<BR><B>Subject:</B> [postgis-devel] What's the point of this exercise in intersects?<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2>I was looking at the lwgeom_geos_c.c intersects function - starting at line 2039 and was thinking isnt' this</FONT></DIV>
<DIV><FONT face=Arial size=2>a bit redundant.  By the time we get into this function we have already done a bounding box check.  It probably isn't adding much overhead, but thought I would flag it as potentially redundant.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> /*<BR>  * short-circuit 1: if geom2 bounding box does not overlap<BR>  * geom1 bounding box we can prematurely return FALSE.<BR>  * Do the test IFF BOUNDING BOX AVAILABLE.<BR>  */<BR> if ( getbox2d_p(SERIALIZED_FORM(geom1), &box1) &&<BR>  getbox2d_p(SERIALIZED_FORM(geom2), &box2) )<BR> {<BR>  if ( box2.xmax < box1.xmin ) PG_RETURN_BOOL(FALSE);<BR>  if ( box2.xmin > box1.xmax ) PG_RETURN_BOOL(FALSE);<BR>  if ( box2.ymax < box1.ymin ) PG_RETURN_BOOL(FALSE);<BR>  if ( box2.ymin > box2.ymax ) PG_RETURN_BOOL(FALSE);<BR> }</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>thanks,</DIV>
<DIV>Regina</DIV>
<DIV> </DIV>
<P>
<HR SIZE=1>

<P></P>
<P><STRONG>The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer. </STRONG></P>
<P>
<HR SIZE=1>

<P></P>
<P><STRONG><FONT color=#339900 size=2>Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </P>
<P></FONT></STRONG></P></DIV></BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>