[mapserver-users] Problem with WFS Filter

Ergün Ayduran (GMX) erguen.ay at gmx.de
Sat Jul 4 02:47:05 EDT 2009


Thx for your answer,

i have solved the problem.

The filter is ok
i think the problem was:
First, i edited the filter in notepad++ an than copied and pasted it in 
firefox.
I think this caused the problem, because some "undefined" characters were 
also copied (but i dont know which characters!?!)

When i edit the filter in a php-script, i get the right response.

----- Original Message ----- 
From: "Yewondwossen Assefa" <yassefa at dmsolutions.ca>
To: ""Ergün Ayduran (GMX)"" <erguen.ay at gmx.de>
Cc: <mapserver-users at lists.osgeo.org>
Sent: Friday, July 03, 2009 4:38 PM
Subject: Re: [mapserver-users] Problem with WFS Filter


> Hi,
>
>  I don't see any obvious problem with your filter. Can you try to set the 
> filter element on your layer to an expression equivalent to your wfs 
> filter, (assuming that the underlying data is a shape/OGR), something like 
> this:  FILTER (([von_pegel] >= 70 or [bis_pegel] <
> > 70) and '[datumzeit]' = '2009-07-09 12:00:00')  and see if you get
> what you expect.  If you get what you expect, you can send me off line 
> your map/data and I can look at it using the wfs filter.
>
> best regards
>
>
> Ergün Ayduran (GMX) wrote:
>> Hi,
>>  i want to filter set a filter in a wfs request:
>> I want to get all polygons, where ("von_pegel" >= 70 or "bis_pegel" < 70) 
>> and datumzeit = 2009-07-09 12:00:00.
>> I tried it with the request:
>> 
>> http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/webgis/mapfile_wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=flood&Filter<Filter><And><Or><PropertyIsGreaterThanOrEqualTo><PropertyName>von_pegel</PropertyName><Literal>70</Literal></PropertyIsGreaterThanOrEqualTo><PropertyIsLessThan><PropertyName>bis_pegel</PropertyName><Literal>70</Literal></PropertyIsLessThan></Or><PropertyIsEqualTo><PropertyName>datumzeit</PropertyName><Literal>2009-07-09%2012:00:00</Literal></PropertyIsEqualTo></And></Filter 
>> <http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/webgis/mapfile_wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=flood&Filter<Filter><And><Or><PropertyIsGreaterThanOrEqualTo><PropertyName>von_pegel</PropertyName><Literal>70</Literal></PropertyIsGreaterThanOrEqualTo><PropertyIsLessThan><PropertyName>bis_pegel</PropertyName><Literal>70</Literal></PropertyIsLessThan></Or><PropertyIsEqualTo><PropertyName>datumzeit</PropertyName><Literal>2009-07-09%2012:00:00</Literal></PropertyIsEqualTo></And></Filter>>
>>  and with this request (is the same request,without %20 in date)
>> 
>> http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/webgis/mapfile_wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=flood&Filter<Filter><And><Or><PropertyIsGreaterThanOrEqualTo><PropertyName>von_pegel</PropertyName><Literal>70</Literal></PropertyIsGreaterThanOrEqualTo><PropertyIsLessThan><PropertyName>bis_pegel</PropertyName><Literal>70</Literal></PropertyIsLessThan></Or><PropertyIsEqualTo><PropertyName>datumzeit</PropertyName><Literal>2009-07-09 
>> <http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/webgis/mapfile_wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=flood&Filter<Filter><And><Or><PropertyIsGreaterThanOrEqualTo><PropertyName>von_pegel</PropertyName><Literal>70</Literal></PropertyIsGreaterThanOrEqualTo><PropertyIsLessThan><PropertyName>bis_pegel</PropertyName><Literal>70</Literal></PropertyIsLessThan></Or><PropertyIsEqualTo><PropertyName>datumzeit</PropertyName><Literal>2009-07-09> 
>> 12:00:00</Literal></PropertyIsEqualTo></And></Filter>
>>  Both requests response me only all polygons.
>>  Example:
>> (1)        0 - 50
>> (2)        50 - 100
>> (3)        100 - 150
>> (4)        150 - 200
>>  Setting the filter should response only (2), (3) and (4)
>> Plz, can anyone tell me, what is wrong in my filter.
>>  EA
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> -- 
> ----------------------------------------------------------------
> Assefa Yewondwossen
> Software Analyst
>
> Email: assefa at dmsolutions.ca
> http://www.dmsolutions.ca/
>
> Phone: (613) 565-5056 (ext 14)
> Fax:   (613) 565-0925
> ---------------------------------------------------------------- 



More information about the mapserver-users mailing list