[mapserver-users] WFS restricting returned attributes

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Aug 24 03:38:53 EDT 2011


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<http://osgeo-org.1803224.n2.nabble.com/WFS-restricting-returned-attributes-tp6719063p6719063.html>
Sent from the Mapserver - User mailing list archive<http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110824/6716b3fb/attachment.html


More information about the mapserver-users mailing list