<div dir="ltr">Hi Even<div><br></div><div>Using python:  </div><div><br></div><div><div>from osgeo import ogr</div><div><br></div><div>driver = ogr.GetDriverByName('WFS')</div></div><div><div>wfs = driver.Open("WFS:<a href="http://www.catais.org/wfs/mopublic">http://www.catais.org/wfs/mopublic</a>?")</div>
</div><div><br></div><div><div>out = "/home/stefan/Projekte/GeoPackage/test5.gpkg"</div><div>outDriver = ogr.GetDriverByName("GPKG")</div><div>outDataSource = outDriver.CreateDataSource(out)</div><div>
<br></div><div>layer = wfs.GetLayerByName('hoheitsgrenzen__hoheitsgrenzpunkt')</div><div>layer.SetAttributeFilter("bfsnr = 2601")</div><div>outLayer = outDataSource.CopyLayer(layer,'test5')</div>
</div><div><br></div><div>I see 4 request in the apache log:</div><div><br></div><div>1. GetCapabilities</div><div>2. DescribeFeatureType</div><div>3. GetFeature </div><div>4. GetFeature</div><div><br></div><div>(3) and (4) are equal except (3) adds ",xsd=/vsimem/tempwfs_0x1e50ad0/file.xsd". But no filter is added, pure GetFeature request.</div>
<div><br></div><div>regards</div><div>Stefan</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 7, 2014 at 8:56 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Le samedi 07 juin 2014 20:46:51, Stefan Ziegler a écrit :<br>

<div class="">> Hi<br>
><br>
> I have a question regarding client/server sided filtering. According to the<br>
> wfs driver website [1] the driver is able to forward spatial and attribute<br>
> filter to the server. If this is not possible it will client-side only<br>
> filtering. When does the driver "decide" wether it filters client or server<br>
> sided? I assume it reads the GetCapabilites file, right?<br>
><br>
> I do have a wfs server which understands ogc filtering (tested with simple<br>
> GET requests in browser)  but the ogr wfs driver does only client sided<br>
> filtering. Probably a broken GetCapabilities file...<br>
<br>
</div>Stefan,<br>
<br>
Well, it should maybe, but generally it assumes that the standard operators<br>
(>,>=,<,<=,==,NOT,AND,OR) are implement by the server.<br>
<br>
The choice between client-side and server-side filtering is based on the<br>
content of the attribute filter. Some stuff can be turned into OGC Filter<br>
language, some not (for example if using special OGR field names).<br>
It maybe also due to a limitation of the current implementation that turn the<br>
SQL into OGC filter<br>
<br>
What is your filter ?<br>
<div class=""><div class="h5"><br>
><br>
> I'm using gdal/ogr 1.11.<br>
><br>
> [1]: <a href="http://www.gdal.org/drv_wfs.html" target="_blank">http://www.gdal.org/drv_wfs.html</a><br>
><br>
><br>
> best regards<br>
> Stefan<br>
<br>
</div></div><span class=""><font color="#888888">--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</font></span></blockquote></div><br></div></div>