Why does my WFS filter not work?

Yewondwossen Assefa yassefa at DMSOLUTIONS.CA
Sun Dec 2 16:27:40 EST 2007


Gregor Mosheh wrote:
> Yewondwossen Assefa wrote:
>> Gregor,
>>  I don't see anything wrong with the request.
>> I did have the expected result.
> 
> Are you saying that when you run this URL, you get back a feature?
> 
  No. All I meant was running the same kind of request on a local 
postgis layer on my machine was giving the expected result.

> http://69.59.158.15/cgi-bin/mapserv?map=/maps/spraywatch2/wms/mapfile.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&typename=parcels&Filter=<Filter><PropertyIsEqualTo><PropertyName>gid</PropertyName><Literal>2389524</Literal></PropertyIsEqualTo></Filter> 
> 
> 
> I get a service exception: "msQueryByRect(): Search returned no results. 
> No matching record(s) found." This is silly since the bbox search shows 
> several matches, some of which would clearly match the filter.
> 
> http://69.59.158.15/cgi-bin/mapserv?map=/maps/spraywatch2/wms/mapfile.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&typename=parcels&srs=EPSG:4326&bbox=168.011840820312,-46.9196395874023,168.127075195312,-46.896656036377 
> 
> 
> I tried filtering by other fields as well, but keep getting not found 
> exceptions.
> 
> The parcels layer (yes, it's PostGIS) is well over 1 GB, so I'm not sure 
> what you want with it.
> 
> This is MS 5.0.0, FYI
> 
Is it possible for you to check mapserver debug messages (set DEBUG true 
on the layer). There should be in the logs the sql statement that is 
supposed to be executed (in your case it would be something like  ... 
WHERE (gid= 2389524) ...  . Does this seem valid? Any other error 
messages in postgres log?  The filter encoding is supposed to set the 
filter element of the layer : FILTER (gid = 2389524).
  I am using the latest Mapserver from svn when doing these tests, 
looking in th logs there is one bug fixed 
http://trac.osgeo.org/mapserver/ticket/2388 that should not impact this.


-- 
----------------------------------------------------------------
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