<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16441" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">I'm running
a contiguity check using the ST_Disjoint function. The results list
the number of distinct polygons for a redistricting plan, some disjoint and some
touching on a corner. I need to distinguish between the two and also
show the total of all. To test this, I created a dataset that
contains 2 sets of disjoint polygons. When I run the ST_Disjoint
expression, the district with 3 disjoint polygons is listed as having 6, while
the district with 2 disjoint polygons is listed as having 2. The feature
type in this layer is polygon. The expression I'm using
is:</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">SELECT
a.district, count(a.district) FROM planfile AS a, planfile AS
b WHERE a.district = b.district AND ST_Disjoint(a.the_geom, b.the_geom)
GROUP BY a.district;</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">Results:</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">district | count</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">----------+----------</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">17B
| 6 (incorrect)</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">26B
| 2 (correct)</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">Am I missing
something? Viewing the data in Quantum GIS shows three disjoint polygons
for district 17B and three unique records in the attribute table.
</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">I took this
further and added another set of disjoint polygons. At first just two, and
the ST_Disjoint function shows two. But when I increased it to four, the
ST_Disjoint function came up with twelve.</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">I've tested this
on two different PostGIS servers with the same results:</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT face="Comic Sans MS">POSTGIS="1.3.2"
GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0 Dec 2007 USE_STATS</FONT></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">POSTGIS="1.3.5" GEOS="3.0.3-CAPI-1.4.2" PROJ="Rel. 4.6.1 21
August 2008 "USE_STATS</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">Thanks in advance for any help.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><SPAN class=214114217-25032009><FONT
face="Comic Sans MS">Lee Meilleur</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV><SPAN class=214114217-25032009><FONT
face="Comic Sans MS"></FONT></SPAN> </DIV>
<DIV> </DIV>
<DIV align=left><FONT face="Comic Sans MS"></FONT> </DIV></BODY></HTML>