Can I make the filter by the value that is obtained by the function?
for feature in iter:
name_dot = feature['name']
print name_dot
expr = QgsExpression("\"name\"=name_dot")
selection= layer.getFeatures(QgsFeatureRequest(expr))
ids = [s.id() for s in selection]
layer.setSelectedFeatures(ids)
iface.mapCanvas().zoomToSelected()
This does not work, and I do not know where the mistake is.
No comments:
Post a Comment