<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19088">
</head>
<body>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial">
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="841461308-24082011">Hi,</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="841461308-24082011"></span></font>&nbsp;</div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="841461308-24082011">I am not too familiar with PostGIS, but isn't this &amp;&amp; exactly an index based BBOX query which is checking if the BBOX of the feature is intersecting with
 the BBOX of the reference geometry?</span></font></div>
<div dir="ltr" align="left"><span class="841461308-24082011">where geom &amp;&amp;<br>
&gt; &gt;&gt; GeomFromText('POLYGON((620000 218000,620000 278000,690000<br>
&gt; &gt;&gt; 278000,690000 218000,620000 218000))',-1) </span></div>
<div dir="ltr" align="left"><span class="841461308-24082011"></span>&nbsp;</div>
<div dir="ltr" align="left"><span class="841461308-24082011"><font color="#0000ff" size="2" face="Arial">&nbsp;Then perhaps what you wrote</font></span></div>
<div dir="ltr" align="left"><span class="841461308-24082011"><font color="#0000ff" size="2" face="Arial">&quot;<font color="#000000" size="3" face="Times New Roman">MapServer filters them correctly but as we get<br>
&gt; only the 100 first results from the DB, we miss many objects and/or<br>
&gt; they are not related to the area where we want to apply a geographical<br>
&gt; filter.&nbsp;&quot;</font></font></span></div>
<div dir="ltr" align="left"><span class="841461308-24082011"></span>&nbsp;</div>
<div dir="ltr" align="left"><span class="841461308-24082011">could better be written &quot;as&nbsp;we&nbsp;get only the 100 first&nbsp;results within the BBOX filtered with&nbsp;fast but inaccurate index search, the result set after Mapserver applying a geographical filter may have
 less that 100 features&quot;.</span></div>
<div dir="ltr" align="left"><span class="841461308-24082011"></span>&nbsp;</div>
<div dir="ltr" align="left"><span class="841461308-24082011"><font color="#0000ff" size="2" face="Arial">-Jukka Rahkonen-</font></span></div>
<div dir="ltr" align="left"><span class="841461308-24082011"><font color="#0000ff" size="2" face="Arial"></font></span>&nbsp;</div>
</font></div>
<div dir="ltr" align="left">&nbsp;</div>
</body>
</html>