<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hi Frank</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have an OpenLayers / Mapserver system, where some of the data comes from a SQL-Server database via OGR. Trying to understand where a FILTER condition is applied. Here is a snippet from my Mapfile:</DIV>
<DIV>&nbsp;</DIV>
<DIV>LAYER<BR>&nbsp; # name of layer<BR>&nbsp; NAME "apiariestm"<BR>&nbsp; TYPE POINT<BR>&nbsp; UNITS METERS<BR>&nbsp; # actual data pointer<BR>&nbsp; CONNECTION "./apiariestm.ovf"<BR>&nbsp; CONNECTIONTYPE OGR<BR>&nbsp; DATA "apiariestm"<BR>&nbsp; FILTER "WHERE apiary_id = '%apiaryid%'"<BR>&nbsp; STATUS ON</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the OGR .ovf file:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;OGRVRTDataSource&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;OGRVRTLayer name="apiariestm"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcDataSource&gt;ODBC:user/passwd@APIARY&lt;/SrcDataSource&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcLayer&gt;vw_ogr_apiary_layer&lt;/SrcLayer&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;LayerSRS&gt;EPSG:2193&lt;/LayerSRS&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryField encoding="PointFromColumns" x="x_nztm" y="y_nztm"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;FID&gt;apiary_id&lt;/FID&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/OGRVRTLayer&gt;<BR>&lt;/OGRVRTDataSource&gt; </DIV>
<DIV>&nbsp;</DIV>
<DIV>The SrcLayer is a view.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does the filter get applied at the Mapserver end, i.e. all the points in the map window get retrieved, and then the filter is applied, or does Mapserver send the filter through to OGR?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Many thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson<BR></DIV><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>