<div dir="ltr">By the way, here is a brief documentation reference about how to apply a filter:<br><br>Look at:<br><br><a href="http://ms.gis.umn.edu/docs/reference/mapfile/layer">http://ms.gis.umn.edu/docs/reference/mapfile/layer</a><br>
<br>and search for "FILTER".<br><br>So, for example, you might achieve the same result as passing in the following CGI variable to a GeoServer WMS call:<br><br>CQL_FILTER="attribute > 50"<br><br>... by passing the following CGI variable to a MapServer WMS call:<br>
<br>MAP_LAYER_0_FILTER="attribute > 50"<br><br>--j<br><br><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 3:57 PM, Josh Marcus <span dir="ltr"><<a href="mailto:jmarcus@avencia.com">jmarcus@avencia.com</a>></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;"><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. But a basic CQL filter (e.g. just checking for equality or greater than or less than) will work unchanged under Mapsever.<br>
<font color="#888888">
<br>--j</font><div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 3:50 PM, Arnd Wippermann <span dir="ltr"><<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>></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" target="_blank">users-bounces@openlayers.org</a> [mailto:<a href="mailto:users-bounces@openlayers.org" target="_blank">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" target="_blank">bartvde@osgis.nl</a><br>
Cc: Openlayers Users List<br>
Betreff: Re: [OpenLayers-Users] CQL queries with WFS<br>
<div><div></div><div><br>
I used the code below but the map still returned all of the villages. It<br>
seems very strange that both my CQL_Filter and URL style filters aren't<br>
working. I'm sure I'm missing something but the filter process just doesn't<br>
seem to like my queries (at least in terms of the syntax I'm using). 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. I'm not sure if this makes sense or<br>
if it is important to the filter problem. Thanks again for your help. If<br>
you have any other suggestions about using the CQL_FILTER or a URL style<br>
filter please let me know. I'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( "villages",<br>
<br>
"<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&typename=villages&request=getfeature&version=1.0.0&service=wfs&" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&typen<br>
ame=villages&request=getfeature&version=1.0.0&service=wfs&</a>",<br>
{<br>
styleMap: oStyleMap<br>
}<br>
);<br>
var value = "nomos='Eleia'";<br>
wfsLayer.mergeNewParams('CQL_FILTER:' + escape(value)); (I've used both :<br>
and = after CQL_FILTER but neither seemed to work)<br>
<br>
________________________________<br>
<br>
From: <a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a> [mailto:<a href="mailto:bartvde@osgis.nl" target="_blank">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" target="_blank">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( "villages",<br>
<br>
<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&typename=villages&request=getfeature&version=1.0.0&service=wfs&,%7B" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&typena<br>
me=villages&request=getfeature&version=1.0.0&service=wfs&,{</a><br>
{<br>
styleMap: oStyleMap<br>
}<br>
);<br>
var value = "nomos='Eleia'";<br>
wfsLayer.mergeNewParams({'CQL_FILTER', escape(value)});<br>
<br>
Best regards,<br>
Bart<br>
<br>
> Bart,<br>
> I tried escaping the quotes around the value of the nomos but<br>
> unfortunately it didn't change the returned results. I used<br>
> backslashes in front of the single quotes around Eleia. Is this what you<br>
had in mind?<br>
> It may be that I'm not escaping the right part of the filter.<br>
> Thanks,<br>
> Todd<br>
> wfsLayer = new OpenLayers.Layer.WFS( "villages",<br>
><br>
<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_FILTER=nomos=%5C%27Eleia%5C%27&typename=villages&request=getfeature&version=1.0.0&service=wfs,%7B" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_FI<br>
LTER=nomos=\'Eleia\'&typename=villages&request=getfeature&version=1.0.0&serv<br>
ice=wfs,{</a><br>
> {<br>
> styleMap: oStyleMap<br>
> }<br>
> );<br>
><br>
> ________________________________<br>
><br>
> From: <a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a> [mailto:<a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a>]<br>
> Sent: Thu 8/14/2008 8:52 AM<br>
> To: Brenningmeyer, Todd<br>
> Cc: Andreas Hocevar; Eric Lemoine; Openlayers Users List<br>
> Subject: Re: [OpenLayers-Users] CQL queries with WFS<br>
><br>
><br>
><br>
> Have you tried escaping the value of your parameter CQL_FILTER?<br>
><br>
> Best regards,<br>
> Bart<br>
><br>
>> Thanks Andreas and Eric. I've tried a few different options with the<br>
>> filter but without success. I'm using the following filter and have<br>
>> tried this with the map location moved into the params section and a<br>
>> few other times with everything in a single URL request but still no<br>
>> luck. The request returns all of the villages with none of these<br>
>> filtered out. If you have any ideas that might help please let me<br>
>> know. Thanks again for your help.<br>
>> Todd<br>
>> wfsLayer = new OpenLayers.Layer.WFS( "villages",<br>
>><br>
"<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_FILTER=nomos=%27Eleia" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_F<br>
ILTER=nomos='Eleia</a>'<br>
>> <<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>
>> p&CQL_FILTER=nomos='Eleia',{//<br>
>> <<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>
>> p&CQL_FILTER=nomos='Eleia',{//<br>
>> <<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>>> p&CQL_FILTER=nomos='Eleia',{//<Filter> ><br>
>> ><PropertyIsEqualTo><PropertyName>nom_nr</PropertyName><Literal>39</L<br>
>> >iteral></PropertyIsEqualTo></Filter><br>
>> ",{<br>
>> service: "WFS",<br>
>> typename: "villages",<br>
>> request: "getfeature",<br>
>> version: "1.0.0"<br>
>> },<br>
>> {<br>
>> extractAttributes: true<br>
>> }<br>
>> );<br>
>><br>
>> Attempt with the params moved into the URL:<br>
>> wfsLayer = new OpenLayers.Layer.WFS( "villages",<br>
>><br>
"<a href="http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_F" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&CQL_F</a><br>
</div><div>ILTER=nomos='Eleia'&typename=villages&request=getfeature&version=1.0.0&servi<br>
</div><div><div></div><div>ce=wfs",{<br>
>> styleMap: oStyleMap<br>
>> }<br>
>> );<br>
>><br>
>> ________________________________<br>
>><br>
>> From: Andreas Hocevar [mailto:<a href="mailto:andreas.hocevar@gmail.com" target="_blank">andreas.hocevar@gmail.com</a>]<br>
>> Sent: Wed 8/13/2008 7:11 AM<br>
>> To: Eric Lemoine<br>
>> Cc: Brenningmeyer, Todd; Openlayers Users List<br>
>> Subject: Re: [OpenLayers-Users] CQL queries with WFS<br>
>><br>
>><br>
>><br>
>> Hi,<br>
>><br>
>> On Wed, Aug 13, 2008 at 2:08 PM, Eric Lemoine <<a href="mailto:eric.c2c@gmail.com" target="_blank">eric.c2c@gmail.com</a>><br>
>> wrote:<br>
>>> On Wed, Aug 13, 2008 at 11:49 AM, Andreas Hocevar<br>
>>> <<a href="mailto:andreas.hocevar@gmail.com" target="_blank">andreas.hocevar@gmail.com</a>> wrote:<br>
>>>> Hi,<br>
>>>><br>
>>>> Since CQL_FILTER is not part to the WMS spec, the best way is to<br>
>>>> add the filter to the WMS url, e.g.<br>
>>>><br>
>>>> var layer=new OpenLayers.Layer.WMS("cql",<br>
>>>> "<a href="http://your-server/wms?CQL_FILTER=foo" target="_blank">http://your-server/wms?CQL_FILTER=foo</a><3", params, options);<br>
>>><br>
>>> Todd's question related to WFS, but I guess the response is similar,<br>
>>> isn't it?<br>
>><br>
>> Should be, yes. Just s/WMS/WFS/gi.<br>
>><br>
>> Regards,<br>
>> Andreas.<br>
>><br>
>> No virus found in this incoming message.<br>
>> Checked by AVG - <a href="http://www.avg.com" target="_blank">http://www.avg.com</a> <<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>><br>
>> <<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>> <<a href="http://www.avg.com/" target="_blank">http://www.avg.com/</a>><br>
>> Version: 8.0.138 / Virus Database: 270.6.2/1609 - Release Date:<br>
>> 8/13/2008<br>
>> 6:43 AM<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@openlayers.org" target="_blank">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>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org" target="_blank">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" target="_blank">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></div></div>
</blockquote></div><br></div>