My select feature is acting weird. I am making a plugin that downloads an WFS layer and then filter out objects based on the features. But when i try to select the points by an area, the points that are selected seems very random. It appears that no matter where i make the selection, the the same points are selected. If I select two points, it's always the same two, if i select ten points, it's always the same ten.
I get the layer by this method:
QgsMapLayerRegistry.instance().addMapLayer(WFSlayer) self.hideLayer(WFSlayer) self.iface.legendInterface().setLayerVisible(WFSlayer, False) layer_name = self.WFSlayer.name() query = "SELECT * FROM " + layer_name + " " + where #where statement created elswhere vLayer = QgsVectorLayer("?query=%s" % (query), "newLayer", "virtual" ) QgsMapLayerRegistry.instance().addMapLayer(vLayer) self.canvas.setExtent(vLayer)
I have another method of adding layer in memory insetad, and this layer does not have the same problem.
I have no idea why this particular layer acts like this, while all others acts normally.