<div dir="ltr">Arnd,<br><br>While MapServer does not support CQL specifically, most CQL filters will work as MapServer filters -- and MapServer filters have some capabilities beyond what CQL will support.&nbsp; But a basic CQL filter (e.g. just checking for equality or greater than or less than) will work unchanged under Mapsever.<br>
<br>--j<br><br><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 3:50 PM, Arnd Wippermann <span dir="ltr">&lt;<a href="mailto:arnd.wippermann@web.de">arnd.wippermann@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Does MapServer support CQL? If so I would be interested. Can someone point<br>
me to a source, how to use it? Internet search shows nothing for MapServer.<br>
<br>
Arnd Wippermann<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: <a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a> [mailto:<a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a>] Im<br>
Auftrag von Brenningmeyer, Todd<br>
Gesendet: Donnerstag, 14. August 2008 17:19<br>
An: <a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a><br>
Cc: Openlayers Users List<br>
Betreff: Re: [OpenLayers-Users] CQL queries with WFS<br>
<div><div></div><div class="Wj3C7c"><br>
I used the code below but the map still returned all of the villages. &nbsp;It<br>
seems very strange that both my CQL_Filter and URL style filters aren&#39;t<br>
working. &nbsp;I&#39;m sure I&#39;m missing something but the filter process just doesn&#39;t<br>
seem to like my queries (at least in terms of the syntax I&#39;m using). &nbsp;The<br>
CQL_Filter params did appear in the params section within firebug when I ran<br>
it but in a vertical format with each letter listed after a number...so 0 C<br>
1 Q 2 L and so on in a vertical column. &nbsp;I&#39;m not sure if this makes sense or<br>
if it is important to the filter problem. &nbsp;Thanks again for your help. &nbsp;If<br>
you have any other suggestions about using the CQL_FILTER or a URL style<br>
filter please let me know. &nbsp;I&#39;ve been tinkering with this for quite a while<br>
without success so your help is very much appreciated.<br>
Thanks again,<br>
Todd<br>
<br>
var wfsLayer = new OpenLayers.Layer.WFS( &quot;villages&quot;,<br>
<br>
&quot;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;typename=villages&amp;request=getfeature&amp;version=1.0.0&amp;service=wfs&amp;" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;typen<br>

ame=villages&amp;request=getfeature&amp;version=1.0.0&amp;service=wfs&amp;</a>&quot;,<br>
 &nbsp;{<br>
 &nbsp; &nbsp;styleMap: oStyleMap<br>
 &nbsp;}<br>
);<br>
var value = &quot;nomos=&#39;Eleia&#39;&quot;;<br>
wfsLayer.mergeNewParams(&#39;CQL_FILTER:&#39; + escape(value)); &nbsp;(I&#39;ve used both :<br>
and = after CQL_FILTER but neither seemed to work)<br>
<br>
________________________________<br>
<br>
From: <a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a> [mailto:<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>]<br>
Sent: Thu 8/14/2008 9:23 AM<br>
To: Brenningmeyer, Todd<br>
Cc: <a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>; Andreas Hocevar; Eric Lemoine; Openlayers Users List<br>
Subject: RE: [OpenLayers-Users] CQL queries with WFS<br>
<br>
<br>
<br>
Can you try something like:<br>
<br>
var wfsLayer = new OpenLayers.Layer.WFS( &quot;villages&quot;,<br>
<br>
<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;typename=villages&amp;request=getfeature&amp;version=1.0.0&amp;service=wfs&amp;,%7B" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;typena<br>

me=villages&amp;request=getfeature&amp;version=1.0.0&amp;service=wfs&amp;,{</a><br>
 &nbsp;{<br>
 &nbsp; &nbsp;styleMap: oStyleMap<br>
 &nbsp;}<br>
);<br>
var value = &quot;nomos=&#39;Eleia&#39;&quot;;<br>
wfsLayer.mergeNewParams({&#39;CQL_FILTER&#39;, escape(value)});<br>
<br>
Best regards,<br>
Bart<br>
<br>
&gt; Bart,<br>
&gt; I tried escaping the quotes around the value of the nomos but<br>
&gt; unfortunately it didn&#39;t change the returned results. &nbsp;I used<br>
&gt; backslashes in front of the single quotes around Eleia. &nbsp;Is this what you<br>
had in mind?<br>
&gt; &nbsp;It may be that I&#39;m not escaping the right part of the filter.<br>
&gt; Thanks,<br>
&gt; Todd<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wfsLayer = new OpenLayers.Layer.WFS( &quot;villages&quot;,<br>
&gt;<br>
<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_FILTER=nomos=%5C%27Eleia%5C%27&amp;typename=villages&amp;request=getfeature&amp;version=1.0.0&amp;service=wfs,%7B" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_FI<br>

LTER=nomos=\&#39;Eleia\&#39;&amp;typename=villages&amp;request=getfeature&amp;version=1.0.0&amp;serv<br>
ice=wfs,{</a><br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; styleMap: oStyleMap<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br>
&gt;<br>
&gt; ________________________________<br>
&gt;<br>
&gt; From: <a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a> [mailto:<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>]<br>
&gt; Sent: Thu 8/14/2008 8:52 AM<br>
&gt; To: Brenningmeyer, Todd<br>
&gt; Cc: Andreas Hocevar; Eric Lemoine; Openlayers Users List<br>
&gt; Subject: Re: [OpenLayers-Users] CQL queries with WFS<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Have you tried escaping the value of your parameter CQL_FILTER?<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Bart<br>
&gt;<br>
&gt;&gt; Thanks Andreas and Eric. &nbsp;I&#39;ve tried a few different options with the<br>
&gt;&gt; filter but without success. &nbsp;I&#39;m using the following filter and have<br>
&gt;&gt; tried this with the map location moved into the params section and a<br>
&gt;&gt; few other times with everything in a single URL request but still no<br>
&gt;&gt; luck. &nbsp;The request returns all of the villages with none of these<br>
&gt;&gt; filtered out. &nbsp;If you have any ideas that might help please let me<br>
&gt;&gt; know. &nbsp;Thanks again for your help.<br>
&gt;&gt; Todd<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wfsLayer = new OpenLayers.Layer.WFS( &quot;villages&quot;,<br>
&gt;&gt;<br>
&quot;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_FILTER=nomos=%27Eleia" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_F<br>
ILTER=nomos=&#39;Eleia</a>&#39;<br>
&gt;&gt; &lt;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma</a><br>
&gt;&gt; p&amp;CQL_FILTER=nomos=&#39;Eleia&#39;,{//<br>
&gt;&gt; &lt;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma</a><br>
&gt;&gt; p&amp;CQL_FILTER=nomos=&#39;Eleia&#39;,{//<br>
&gt;&gt; &lt;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.ma</a><br>
</div></div><div class="Ih2E3d">&gt;&gt; p&amp;CQL_FILTER=nomos=&#39;Eleia&#39;,{//&lt;Filter&gt; &gt;<br>
&gt;&gt; &gt;&lt;PropertyIsEqualTo&gt;&lt;PropertyName&gt;nom_nr&lt;/PropertyName&gt;&lt;Literal&gt;39&lt;/L<br>
&gt;&gt; &gt;iteral&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;<br>
&gt;&gt; &quot;,{<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service: &quot;WFS&quot;,<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;typename: &quot;villages&quot;,<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;request: &quot;getfeature&quot;,<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;version: &quot;1.0.0&quot;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extractAttributes: true<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br>
&gt;&gt;<br>
&gt;&gt; Attempt with the params moved into the URL:<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wfsLayer = new OpenLayers.Layer.WFS( &quot;villages&quot;,<br>
&gt;&gt;<br>
&quot;<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_F" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&amp;CQL_F</a><br>
</div><div class="Ih2E3d">ILTER=nomos=&#39;Eleia&#39;&amp;typename=villages&amp;request=getfeature&amp;version=1.0.0&amp;servi<br>
</div><div><div></div><div class="Wj3C7c">ce=wfs&quot;,{<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; styleMap: oStyleMap<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br>
&gt;&gt;<br>
&gt;&gt; ________________________________<br>
&gt;&gt;<br>
&gt;&gt; From: Andreas Hocevar [mailto:<a href="mailto:andreas.hocevar@gmail.com">andreas.hocevar@gmail.com</a>]<br>
&gt;&gt; Sent: Wed 8/13/2008 7:11 AM<br>
&gt;&gt; To: Eric Lemoine<br>
&gt;&gt; Cc: Brenningmeyer, Todd; Openlayers Users List<br>
&gt;&gt; Subject: Re: [OpenLayers-Users] CQL queries with WFS<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Aug 13, 2008 at 2:08 PM, Eric Lemoine &lt;<a href="mailto:eric.c2c@gmail.com">eric.c2c@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt; On Wed, Aug 13, 2008 at 11:49 AM, Andreas Hocevar<br>
&gt;&gt;&gt; &lt;<a href="mailto:andreas.hocevar@gmail.com">andreas.hocevar@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Since CQL_FILTER is not part to the WMS spec, the best way is to<br>
&gt;&gt;&gt;&gt; add the filter to the WMS url, e.g.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; var layer=new OpenLayers.Layer.WMS(&quot;cql&quot;,<br>
&gt;&gt;&gt;&gt; &quot;<a href="http://your-server/wms?CQL_FILTER=foo" target="_blank">http://your-server/wms?CQL_FILTER=foo</a>&lt;3&quot;, params, options);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Todd&#39;s question related to WFS, but I guess the response is similar,<br>
&gt;&gt;&gt; isn&#39;t it?<br>
&gt;&gt;<br>
&gt;&gt; Should be, yes. Just s/WMS/WFS/gi.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Andreas.<br>
&gt;&gt;<br>
&gt;&gt; No virus found in this incoming message.<br>
&gt;&gt; Checked by AVG - <a href="http://www.avg.com" target="_blank">http://www.avg.com</a> &lt;<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>&gt;<br>
&gt;&gt; &lt;<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>&gt; &lt;<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>&gt;<br>
&gt;&gt; Version: 8.0.138 / Virus Database: 270.6.2/1609 - Release Date:<br>
&gt;&gt; 8/13/2008<br>
&gt;&gt; 6:43 AM<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Users mailing list<br>
&gt;&gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
&gt;&gt; <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>