<pre>Thanks Nicklas,<br>I suspected something like that - but our custom viewer doesn't show the polygon that way .... I'll try udig and failing that QGIS and see if we can clean up the polygon.<br><br>Bryan.<br><br>

>Well, I looked at it in QGIS and the line seems to cross the border of<br>>the polygon. I have attached the part of the polygon where it crosses,<br>>with the line in violet and the intersecting part in green.<br>

><br>>/Nicklas<br>><br>>On Tue, 2011-01-25 at 15:00 -0500, Bryan Montgomery wrote:<br>>><i> Hello,<br></i>>><i> Is there a way to debug a problem I have with a polygon and line? I<br></i>><i>> was running a query that used st_intersects and st_intersection to get<br>

</i>><i>> the length of lines that are within the polygon. I was spot checking<br></i>><i>> some of the data and came up with a particularly strange example.<br></i>><i>> <br></i>><i>> Visually, the polygon looks as it should, the line clearly appears to<br>

</i>><i>> be completely contained within the polygon however st_crosses returns<br></i>><i>> true and intersection returns a subset of the line. I've tried this on<br></i>><i>> postgis version 1.3 and 1.4 and both behave the same. I'm inclined to<br>

</i>><i>> believe there is a stray point but given the polygon 2,700+ points I'm<br></i>><i>> not sure how I find it! I suppose it's possible that there is a bug -<br></i>><i>> or maybe I'm just completely missing something.<br>

</i>><i>> <br></i>><i>> I tried finding the closest point on the polygon to the line - but<br></i>><i>> when I tried to find a way to do this it seemed that the suggestions<br></i>><i>> were for finding the closest point when the other point was outside<br>

</i>>><i> the polygon?<br></i>>><i> <br></i>>><i> Appreciate any help,<br>>></i><i> <br></i>>><i> Thanks - Bryan.<br></i>>><i> _______________________________________________<br></i></pre>