<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name="Microsoft Theme 2.00" content="Arctic 011"><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri","sans-serif";
color:black;}
h1
{mso-style-priority:9;
mso-style-link:"Heading 1 Char";
margin-top:24.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:16.0pt;
font-family:"Calibri","sans-serif";
color:black;}
h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h3
{mso-style-priority:9;
mso-style-link:"Heading 3 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h4
{mso-style-priority:9;
mso-style-link:"Heading 4 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h5
{mso-style-priority:9;
mso-style-link:"Heading 5 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h6
{mso-style-priority:9;
mso-style-link:"Heading 6 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#9D454F;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#814E95;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
color:black;}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-priority:9;
mso-style-link:"Heading 1";
font-family:"Verdana","sans-serif";
color:black;
font-weight:bold;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Verdana","sans-serif";
color:black;}
span.Heading3Char
{mso-style-name:"Heading 3 Char";
mso-style-priority:9;
mso-style-link:"Heading 3";
font-family:"Verdana","sans-serif";
color:black;}
span.Heading4Char
{mso-style-name:"Heading 4 Char";
mso-style-priority:9;
mso-style-link:"Heading 4";
font-family:"Verdana","sans-serif";
color:black;}
span.Heading5Char
{mso-style-name:"Heading 5 Char";
mso-style-priority:9;
mso-style-link:"Heading 5";
font-family:"Verdana","sans-serif";
color:black;}
span.Heading6Char
{mso-style-name:"Heading 6 Char";
mso-style-priority:9;
mso-style-link:"Heading 6";
font-family:"Verdana","sans-serif";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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 bgcolor=white background="cid:image001.gif@01CD09C0.88470920" lang=EN-US link="#9D454F" vlink="#814E95"><img src="cid:image001.gif@01CD09C0.88470920" v:src="cid:image001.gif@01CD09C0.88470920" v:shapes="_x0000_Mail" width=0 height=0 class=shape style='display:none;width:0;height:0'><!--[if gte mso 9]><xml>
<v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="800,600">
<v:fill src="cid:image001.gif@01CD09C0.88470920" o:title="background_arctic" type="frame" />
</v:background></xml><![endif]--><div class=WordSection1><p class=MsoNormal>I created a table of ST_ClosestPoint()s to polylines. I assumed that if the closest points were on the line the queries below would give equal results, but that’s not happening.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“InsideWorking”.simplified is a line.<o:p></o:p></p><p class=MsoNormal>“gaps”.closeststartpoint is a point.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT "gaps".closeststartpoint FROM "gaps" <o:p></o:p></p><p class=MsoNormal>WHERE "gaps".closeststartpoint IS NOT NULL; --Query produces 462 results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT * FROM "gaps","InsideWorking" <o:p></o:p></p><p class=MsoNormal>WHERE ST_Covers("InsideWorking".simplified,"gaps".closeststartpoint); --Query produces 1228 results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT * FROM "gaps","InsideWorking" <o:p></o:p></p><p class=MsoNormal>WHERE ST_Contains("InsideWorking".simplified,"gaps".closeststartpoint); --Query produces 548 results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT "gaps".closeststartpoint FROM "gaps","InsideWorking" <o:p></o:p></p><p class=MsoNormal>WHERE ST_Touches("InsideWorking".simplified,"gaps".closeststartpoint); --Query produces 680 results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>--------------------------------------------------------------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT "gaps".closeststartpoint FROM "gaps","InsideWorking" <o:p></o:p></p><p class=MsoNormal>WHERE ST_DWithin("InsideWorking".simplified,"gaps".closeststartpoint,0); --Query produces 1258 results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Inspection shows the ST_DWithin() query is getting better results than the other queries. So I think I’ve got something that works, but I’d appreciate some advice on why the others don’t give similar results.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks in advance.<o:p></o:p></p></div></body></html>