[Qgis-user] WFS with filters

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Thu Jun 2 01:38:39 PDT 2011


Hi,

There is indeed a free text field in the 1.8.0 trunk version, thanks for that.
It in not perhaps so handy for average users if the user is supposed to paste a working ready made xml filter there. Examples of nice query builders for WFS can be found from Kosmo GIS, deegree iGeoDesktop, OpenJUMP WFS-plugin and Cadcorp SIS Map Browser. Anyway, even it there will be a query builder some day the raw xml filter possibility should be maintained. 

I had a quick try and found that there is something wrong in the filter in my original mail. However, I could verify that QGis is adding the filter into the GetFeature request. I noticed also that it is adding it to all WFS requests, also to GetCapabilities and DescribeFeatureType even it does not make much sense. It is not dangerous, too, because extra parameters are then omitted.

-Jukka Rahkonen-


Stefan Keller wrote:

> Hi Jukka

> I think it's now implemented in the trunk (see qgis-dev).
> It's a free text field when opening the WFS.

> Yours, Stefan

> 2011/5/15 Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>:
>> Hi,
>>
>> What is the situation with the ticket
>> https://trac.osgeo.org/qgis/ticket/3728 about making filtered GetFeatures
>> from WFS?
>>
>> For example with OpenStreetMap WFS layers the plain GetFeature (possibly
>> with BBOX) does not yield the most usable data for users. By this request
>> the user gets all kind of polygons like buildings, lakes and playgrounds.
>>
>> http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=getfeature&typename=tows:osm_polygon&maxfeatures=100
>>
>> While this one gives just lakes with natural=water filter:
>
>> http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=getfeature&typename=tows:osm_polygon&maxfeatures=100&filter=%3CFilter%20%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Etows:natural%3C/PropertyName%3E%3CLiteral%3Ewater%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E
>
> Naturally the normal usage is to use http POST but it is easier to show an
> example with http GET url.
>
> Of the existing open source GIS programs perhaps the best examples about how
> to build WFS filters can be found from iGeoDesktop (http://www.deegree.org)
> and Kosmo (http://opengeo.es). Observe that user can also create spatial
> filters by using the geometry of a feature that is selected from the map
> window.  This enables queries like "select features having ATTRIBUTE1=xxx
> AND ATTRIBUTE2=YYY within distance of 20km from the selected
> feature".  CadCorp SIS MapBrowser is also worth having a look.
>
> -Jukka Rahkonen-
>
>
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>






More information about the Qgis-user mailing list