[mapserver-users] Re: WFS restricting returned attributes

bteluk at gmail.com bteluk at gmail.com
Wed Aug 24 22:18:29 EDT 2011


Hi Jukka,

Thanks for your response.  Made some progress, but still got some problems.

I tried using the the two following GET requests to restrict the
property/attribute lists, using the syntax/capitalisation as read from the
OGC WFS 1.1.0 recommendation:

This example follows:

This one follows the documentation for the PROPERTYNAME query parameter from
Sect 14.7.3.1 of the recommendation:

This one derives from the example from Sect 9.5, Ex 2 of the recommendation:


I get a response back, but it includes all the attributes irrespective of my
request.  So still have the attribute restricting problem unsolved.

I tried with POST requests - and with a few more variations of the XML, but
without luck.  It seems as if the server at the other end just ignores the
request to restrict the attributes.

I checked with the filter updated as per your suggestion and added a BBOX
element enclosing - this fixed the filter bit and got a correctly filtered
response.


I did find some unusal things about the server - it doesn't like a
"User-Agent" header in the HTTP request - this was causing my testing some
problems.  I don't know if that's something to do with MS 5.4.2, or it maybe
because they have some sort of front end to the server perhaps.

Thanks for your help!

Regards, Bill.



Rahkonen Jukka wrote:
> 
> Hi,
> 
> You can try if service takes list of propertynames with GET like
> 
> http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.0.0&request=GetFeature&typename=lv:mml_railway&BBOX=246700,6780800,436400,6924000&propertyname=sahko,the_geom&maxfeatures=1
> 
> When it comes to filters, I am not sure how strict Mapserver is but I
> would first have a try by correcting the errors (Filter instead of filter,
> Within and not within) and using it as URL-encoded in the URL.  TinyOWS
> accepts GET filters when used like this.
> 
> http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=getfeature&typename=tows:osm_point&maxfeatures=10&filter=%3CFilter%20%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Etows:amenity%3C/PropertyName%3E%3CLiteral%3Ewaste_basket%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E
> 
> -Jukka Rahkonen-
>  bteluk  wrote:
> Hi, I'm a user of a service provider that uses MapServer V5.4.2. I'm using
> their WFS Service. I'm trying to restrict the set of attributes that are
> returned by using a POST'ed Query in my request. But it doesn't seem to
> work. The service provider is using V5.4.2. I've tried equivalent queries
> on my own server (a V5.6.0) which works fine. Would this a
> problem/limitation of the service providers server?(eg. version problem or
> config setting) Or am I missing stuff in the namespaces/schema
> declarations? Or is it perhaps the query I'm using? My POST query looks
> like this:
> 
> <wfs:GetFeature
> xmlns:wfs="http://www.opengis.net/wfs"
> service="WFS"
> version="1.0.0"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <wfs:Query typeName="ms:IDY03103_dryblb"
> xmlns:ms="http://mapserver.gis.umn.edu/mapserver">
> <ogc:PropertyName
> xmlns:ogc="http://www.opengis.net/ogc">msGeometry</ogc:PropertyName>
> <ogc:PropertyName
> xmlns:ogc="http://www.opengis.net/ogc">datetime</ogc:PropertyName>
> <ogc:PropertyName
> xmlns:ogc="http://www.opengis.net/ogc">id_num</ogc:PropertyName>
> <ogc:PropertyName
> xmlns:ogc="http://www.opengis.net/ogc">id_name</ogc:PropertyName>
> </wfs:Query>
> </wfs:GetFeature>
> 
> 
> NB. am setting the content type to "text/xml", Also tried a GET request
> with the filter:
> 
> wget -O dbtemp.gml
> "http://someserviceprovider.com/cgi-bin/mapserv?SERVICE=WFS&
> VERSION=1.1.0&REQUEST=GetFeature&TypeName=IDY03103_dryblb&FILTER=(<filter><within>
> <PropertyName>msGeometry</PropertyName><gml:Envelope srsName="EPSG:4283">
> <gml:lowerCorner>138 -29</gml:lowerCorner><gml:upperCorner>155
> -43</gml:upperCorner>
> </gml:Envelope></within></filter>)"
> 
> 
> Response extract:
> 
> <ows:Exception exceptionCode="filter" locator="InvalidParameterValue">
>     <ows:ExceptionText>msWFSGetFeature(): WFS server error. Invalid or
> Unsupported FILTER in
> GetFeature : (&lt;filter&gt;&lt;within&gt;&lt;PropertyName.............to
> the end of the filter string!
> 
> 
> Thanks in advance! Regards, Bill Teluk
> Regards, Bill Teluk
> 
> ________________________________
> View this message in context: WFS restricting returned
> attributes&lt;http://osgeo-org.1803224.n2.nabble.com/WFS-restricting-returned-attributes-tp6719063p6719063.html&gt;
> Sent from the Mapserver - User mailing list
> archive&lt;http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html&gt;
> at Nabble.com.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


-----
Regards, Bill Teluk
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/WFS-restricting-returned-attributes-tp6719063p6723028.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list