<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE>BODY {
        FONT-SIZE: 13px; FONT-FAMILY: Helvetica,Arial
}
</STYLE>

<META name=GENERATOR content="MSHTML 10.00.9200.17088"></HEAD>
<BODY 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=162041123-26092014><FONT size=4>Fine by 
me.  I at first thought in my imagination that it was possible for a box to 
not contain another box and for the geometries that have those boxes to contain 
each other.  But after thinking some more I convinced myself it's not 
possible in this world or any we would consider.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=162041123-26092014><FONT 
size=4></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=162041123-26092014><FONT 
size=4>Regina</FONT></SPAN></DIV><BR>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-devel-bounces@lists.osgeo.org 
[mailto:postgis-devel-bounces@lists.osgeo.org] <B>On Behalf Of </B>Paul 
Ramsey<BR><B>Sent:</B> Friday, September 26, 2014 5:51 PM<BR><B>To:</B> PostGIS 
Development Discussion<BR><B>Subject:</B> [postgis-devel] ST_Contains / 
ST_Within<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV id=bloop_customfont 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica,Arial; COLOR: ; MARGIN: 0px">I 
was just working through strategy numbers and thinking about how we only ever 
use RTOverlapStrategyNumber when I realized that we should be using other 
strategies for at least a few of our functions, and yet we have </DIV>
<DIV id=bloop_customfont 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica,Arial; COLOR: ; MARGIN: 0px"><BR></DIV>
<DIV id=bloop_customfont style="MARGIN: 0px">
<DIV id=bloop_customfont style="MARGIN: 0px">CREATE OR REPLACE FUNCTION 
ST_Contains(geom1 geometry, geom2 geometry)</DIV>
<DIV id=bloop_customfont style="MARGIN: 0px">        RETURNS 
boolean</DIV>
<DIV id=bloop_customfont style="MARGIN: 0px">        AS 
'SELECT $1 && $2 AND _ST_Contains($1,$2)'</DIV>
<DIV id=bloop_customfont style="MARGIN: 0px">        
LANGUAGE 'sql' IMMUTABLE;</DIV>
<DIV 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica, Arial; COLOR: rgb(0,0,0)"><BR></DIV>
<DIV 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica, Arial; COLOR: rgb(0,0,0)">When 
really it should be</DIV>
<DIV 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica, Arial; COLOR: rgb(0,0,0)"><BR></DIV>
<DIV>
<DIV>CREATE OR REPLACE FUNCTION ST_Contains(geom1 geometry, geom2 
geometry)</DIV>
<DIV>        RETURNS boolean</DIV>
<DIV>        AS 'SELECT $1 ~ $2 AND 
_ST_Contains($1,$2)'</DIV>
<DIV>        LANGUAGE 'sql' IMMUTABLE;</DIV>
<DIV 
style="FONT-SIZE: 13px; FONT-FAMILY: Helvetica, Arial; COLOR: rgb(0,0,0)"><BR></DIV></DIV></DIV>Probably 
a small efficiency savings to be had in reducing the number of geometries to be 
exact tested. Anyone see a reason we shouldn’t do this?
<DIV><BR></DIV>
<DIV>P.<BR>
<DIV id=bloop_sign_1411768096253304064 class=bloop_sign>
<DIV><BR></DIV>-- <BR>Paul Ramsey<BR>http://cleverelephant.ca
<DIV>http://postgis.net </DIV>
<SCRIPT type=application/ld+json>
{
  "@context": "http://schema.org",
  "@type": "em",
  "name": "John Doe",
  "jobTitle": "Graduate research assistant",
  "affiliation": "University of Dreams",
  "additionalName": "Johnny",
  "url": "http://www.example.com",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "1234 Peach Drive",
    "addressLocality": "Wonderland",
    "addressRegion": "Georgia"
  }
}
</SCRIPT>
</DIV></DIV></BODY></HTML>