<div dir="ltr"><div>Addendum.</div><div><br></div><div>I discovered what problem was.</div><div><br></div><div>OWSLib generates an URL like this:</div><div><br></div><div>http:// ....WFSHOST .../&FILTER=<ogc:PropertyIsLike  wildCard="%" singleChar="_" escapeChar="\" matchCase="false"><ogc:PropertyName>nome_via</ogc:PropertyName><ogc:Literal>VIA A%</ogc:Literal></ogc:PropertyIsLike></div><div><br></div><div>but it seems that QGIS Server doesn't like this. We should add <ogc:Filter> and </ogc:Filter> at start and the end of the FILTER value:</div><div><br></div><div>http:// ....WFSHOST .../&FILTER=<ogc:Filter><ogc:PropertyIsLike  wildCard="%" singleChar="_" escapeChar="\" matchCase="false"><ogc:PropertyName>nome_via</ogc:PropertyName><ogc:Literal>VIA A%</ogc:Literal></ogc:PropertyIsLike></ogc:Filter></div><div><br></div><div>with the last URL, the WFS query works!<br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 11 giu 2019 alle ore 14:18 Luca Manganelli <<a href="mailto:luca.manganelli@comune.trento.it">luca.manganelli@comune.trento.it</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to make this python 3 code with OwsLib working.</div><div>In particular, I'm searching a road with the name starting by "VIA F.", but QGIS Server returns me a road named VIA MATTEOTTI...<br></div><div><br></div><div>Does QGIS Server support PropertyIsLike in WFS?<br></div><div><br></div><div><br></div><div>#!/usr/bim/python3<br></div><div>from owslib.wfs import WebFeatureService<br>from owslib.etree import etree<br>from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox<br><br>wfs = WebFeatureService(url='<a href="https://cartografia.comunelavis.it/wms/cbase" target="_blank">https://cartografia.comunelavis.it/wms/cbase</a>')<br><br>filt = PropertyIsLike(propertyname='nome_via', literal='VIA F.%', wildCard='%', matchCase=False)<br>filterxml = etree.tostring(filt.toXML()).decode("utf-8")<br><br>feature = wfs.getfeature(typename=['Civici'], maxfeatures=1, filter=filterxml)<br>gml = etree.parse(feature)</div><div>print(etree.tostring(gml))<br></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Luca Manganelli<br>Assistente informatico<br>Servizio Innovazione e Sistemi digitali<br>Via Ezio Maccani 148<br>38121 Trento (TN)</div></div></div>