Nicol,<br><br><div><span class="gmail_quote">On 9/15/05, <b class="gmail_sendername">Nicol Hermann</b> <<a href="mailto:postgis@geoworld.de">postgis@geoworld.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
i wonder why the following statements returns different results:<br><br>select within(GeomFromText('POLYGON((10 10,30 10,30 20,10 20,10 10))',<br>-1), GeomFromText('POLYGON((0 0, 40 0, 40 30, 30 0, 0 0))', -1) );<br>=> FALSE
</blockquote><div><br>

<br>

If you are trying to test intesections between two rectangles, I
believe you have your X&Y switched in the 4th coordinate of your 
second geometry:<br>

<br>

instead of:<br>

<br>

select within(GeomFromText('POLYGON((10 10,30 10,30 20,10 20,10 10))',<br>

<div id="mb_0">-1), GeomFromText('POLYGON((0 0, 40 0, 40 30, 30 0, 0 0))', -1) );<br>=> FALSE<br>
<br>
it should be:<br>
<br>
select within(GeomFromText('POLYGON(
<div id="mb_0">(10 10,30 10,30 20,10 20,10 10))',<br>-1), GeomFromText('POLYGON((0 0, 40 0, 40 30, 0 30, 0 0))', -1) );</div>
=> TRUE<br><br></div>
According to the original geometry as defined in your query, geos was
returning the correct result. (A simple sketch on graph paper will show
you why... does anyone use graph paper anymore or am I the only one ??)<br>
<br>
-- <br>
Matt Perry<br>
<a href="mailto:perrygeo@gmail.com">perrygeo@gmail.com</a><br>
<a href="http://www.perrygeo.net">http://www.perrygeo.net</a> </div></div>