[OpenLayers-Users] CQL queries with WFS

bartvde at osgis.nl bartvde at osgis.nl
Thu Aug 14 09:52:48 EDT 2008


Have you tried escaping the value of your parameter CQL_FILTER?

Best regards,
Bart

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





More information about the Users mailing list