pygeofilter icon indicating copy to clipboard operation
pygeofilter copied to clipboard

django like filter wont work for various wildcard chars

Open jokiefer opened this issue 1 year ago • 0 comments

Status Quo

if a fes filter:

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
 <ogc:And>
  <ogc:PropertyIsEqualTo>
   <ogc:PropertyName>Type</ogc:PropertyName>
   <ogc:Literal>dataset</ogc:Literal>
  </ogc:PropertyIsEqualTo>
  <ogc:PropertyIsLike wildCard="*" singleChar="_" escapeChar="/">
   <ogc:PropertyName>AnyText</ogc:PropertyName>
   <ogc:Literal>*potentielle Evapotranspiration*</ogc:Literal>
  </ogc:PropertyIsLike>
 </ogc:And>
</ogc:Filter>

is converted to a django filter, the like query will result in a exact lookup for *potentielle Evapotranspiration*

This is cause the current like function does not take into account the wildCard char. It will always use the hard coded % char as wildcard.

jokiefer avatar Nov 14 '23 14:11 jokiefer