<div dir="ltr">Hi<div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 27, 2015 at 6:00 PM, luna <span dir="ltr"><<a href="mailto:luna.helios@googlemail.com" target="_blank">luna.helios@googlemail.com</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"><br>
Now I try to set up the MatchFilter to get matches only from a particular<br>
feature ID. But I don't know how to begin.</blockquote><div><br></div><div>You need to implement your own MatchFilter subclass and pass it to one of the functions that use it. For example, this is how to limit search to feature id 5:</div><div><br></div><div>class FidFilter(QgsPointLocator.MatchFilter):</div><div>  def __init__(self, fid):</div><div>    QgsPointLocator.MatchFilter.__init__(self)</div><div>    self.fid = fid</div><div>  def acceptMatch(self, m):</div><div>    return m.featureId() == self.fid</div><div><br></div><div>m = locator.nearestVertex(QgsPoint(100,200), 10, FidFilter(5))</div><div><br></div><div><br></div><div>Cheers</div><div>Martin</div><div><br></div></div></div></div>