<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
..MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>Not quite enough information there to 
guess.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>select  postgis_full_version();</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>instead of postgis_version()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>That will give the exact Geos version you are 
running.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=292134311-31122007><FONT face=Arial 
color=#0000ff size=2>Regina</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>James 
DeMichele<BR><B>Sent:</B> Friday, December 28, 2007 2:25 PM<BR><B>To:</B> 
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] 
ST_contains() throws an error<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal>Hi,<o:p></o:p></P>
<P class=MsoNormal>I have a table with 27000 records and each record has 2 
geometry columns. The first column has an original MULTIPOLYGON (named 
original_poly), and the second column has some tweaks (buffer and 
simplification) applied to the original data, and is also stored as a 
MULTIPOLYGON (named new_poly).<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I want to get the list of these rows where the new_poly does 
NOT contain the original_poly. The first time I ran it, I got this: 
“ERROR:  GEOS contains() threw an error!”<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>So, then I thought that maybe some of the polygons were not 
valid. There were 6 invalid polygons, so then I tried running this 
query:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>select count(*) <o:p></o:p></P>
<P class=MsoNormal>from temp_places_buffer <o:p></o:p></P>
<P class=MsoNormal>where(st_isvalid(new_poly) = true and st_isvalid(redfin_poly) 
= true) <o:p></o:p></P>
<P class=MsoNormal>and not st_contains(t1.new_poly, 
t1.redfin_poly);<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Unfortunately, I still get this error:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>ERROR:  GEOS contains() threw an error!<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>What are possible reasons that this would still be throwing 
an error, other than invalid polygons, since the query should now only be 
calculating st_contains on valid polygons?<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I am running this version:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P 
class=MsoNormal>            
postgis_version<o:p></o:p></P>
<P class=MsoNormal>---------------------------------------<o:p></o:p></P>
<P class=MsoNormal> 1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Thanks.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>-James<o:p></o:p></P></DIV></BODY></HTML>